react-native-reanimated 2.8.0 → 2.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (224) hide show
  1. package/Common/cpp/AnimatedSensor/AnimatedSensorModule.cpp +4 -4
  2. package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +38 -0
  3. package/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp +23 -0
  4. package/Common/cpp/Tools/RuntimeDecorator.cpp +17 -11
  5. package/Common/cpp/headers/NativeModules/NativeReanimatedModule.h +8 -0
  6. package/Common/cpp/headers/NativeModules/NativeReanimatedModuleSpec.h +8 -0
  7. package/Common/cpp/headers/Tools/PlatformDepMethodsHolder.h +5 -0
  8. package/RNReanimated.podspec +22 -3
  9. package/android/.gradle/7.2/dependencies-accessors/dependencies-accessors.lock +0 -0
  10. package/android/.gradle/7.2/executionHistory/executionHistory.bin +0 -0
  11. package/android/.gradle/7.2/executionHistory/executionHistory.lock +0 -0
  12. package/android/.gradle/7.2/fileHashes/fileHashes.bin +0 -0
  13. package/android/.gradle/7.2/fileHashes/fileHashes.lock +0 -0
  14. package/android/.gradle/7.2/fileHashes/resourceHashesCache.bin +0 -0
  15. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  16. package/android/.gradle/buildOutputCleanup/cache.properties +1 -1
  17. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  18. package/android/.gradle/checksums/checksums.lock +0 -0
  19. package/android/.gradle/checksums/md5-checksums.bin +0 -0
  20. package/android/.gradle/checksums/sha1-checksums.bin +0 -0
  21. package/android/CMakeLists.txt +216 -84
  22. package/android/build.gradle +255 -229
  23. package/android/react-native-reanimated-66-hermes.aar +0 -0
  24. package/android/react-native-reanimated-66-jsc.aar +0 -0
  25. package/android/react-native-reanimated-67-hermes.aar +0 -0
  26. package/android/react-native-reanimated-67-jsc.aar +0 -0
  27. package/android/react-native-reanimated-68-hermes.aar +0 -0
  28. package/android/react-native-reanimated-68-jsc.aar +0 -0
  29. package/android/react-native-reanimated-69-hermes.aar +0 -0
  30. package/android/react-native-reanimated-69-jsc.aar +0 -0
  31. package/android/react-native-reanimated-70-hermes.aar +0 -0
  32. package/android/react-native-reanimated-70-jsc.aar +0 -0
  33. package/{lib/types/lib/reanimated2/platform-specific/RNRenderer.web.d.ts → android/rnVersionPatch/69/.gitkeep} +0 -0
  34. package/android/rnVersionPatch/70/.gitkeep +0 -0
  35. package/android/src/main/cpp/NativeProxy.cpp +56 -11
  36. package/android/src/main/cpp/OnLoad.cpp +1 -0
  37. package/android/src/main/cpp/headers/NativeProxy.h +29 -0
  38. package/android/src/main/java/com/swmansion/reanimated/NativeProxy.java +25 -0
  39. package/android/src/main/java/com/swmansion/reanimated/NodesManager.java +3 -1
  40. package/android/src/main/java/com/swmansion/reanimated/keyboardObserver/ReanimatedKeyboardEventListener.java +165 -0
  41. package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/AnimationsManager.java +19 -16
  42. package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensor.java +5 -1
  43. package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensorListener.java +24 -1
  44. package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensorType.java +7 -5
  45. package/ios/REANodesManager.m +31 -8
  46. package/ios/keyboardObserver/REAKeyboardEventObserver.h +17 -0
  47. package/ios/keyboardObserver/REAKeyboardEventObserver.m +198 -0
  48. package/ios/native/NativeProxy.mm +20 -1
  49. package/ios/native/REAInitializer.mm +10 -4
  50. package/ios/sensor/ReanimatedSensor.m +27 -18
  51. package/lib/Animated.js +8 -21
  52. package/lib/index.js +12 -20
  53. package/lib/index.web.js +4 -0
  54. package/lib/reanimated2/Colors.js +1 -1
  55. package/lib/reanimated2/NativeMethods.js +3 -0
  56. package/lib/reanimated2/NativeReanimated/NativeReanimated.js +7 -1
  57. package/lib/reanimated2/animation/sequence.js +0 -3
  58. package/lib/reanimated2/animation/util.js +4 -1
  59. package/lib/reanimated2/commonTypes.js +8 -1
  60. package/lib/reanimated2/component/FlatList.js +8 -8
  61. package/lib/reanimated2/component/Image.js +4 -0
  62. package/lib/reanimated2/component/ScrollView.js +4 -0
  63. package/lib/reanimated2/component/Text.js +4 -0
  64. package/lib/reanimated2/component/View.js +4 -0
  65. package/lib/reanimated2/core.js +5 -9
  66. package/lib/reanimated2/frameCallback/FrameCallbackRegistryJS.js +32 -0
  67. package/lib/reanimated2/frameCallback/FrameCallbackRegistryUI.js +47 -0
  68. package/lib/reanimated2/globals.d.ts +3 -0
  69. package/lib/reanimated2/hook/index.js +2 -0
  70. package/lib/reanimated2/hook/useAnimatedKeyboard.js +31 -0
  71. package/lib/reanimated2/hook/useAnimatedSensor.js +3 -3
  72. package/lib/reanimated2/hook/useFrameCallback.js +23 -0
  73. package/lib/reanimated2/hook/utils.js +0 -5
  74. package/lib/reanimated2/jestUtils.js +11 -3
  75. package/lib/reanimated2/js-reanimated/JSReanimated.js +7 -0
  76. package/lib/reanimated2/js-reanimated/global.js +36 -0
  77. package/lib/reanimated2/js-reanimated/index.js +0 -24
  78. package/lib/reanimated2/layoutReanimation/LayoutAnimationRepository.js +1 -1
  79. package/lib/reanimated2/mock.js +6 -0
  80. package/lib/types/Animated.d.ts +8 -0
  81. package/lib/types/{lib/ConfigHelper.d.ts → ConfigHelper.d.ts} +0 -0
  82. package/lib/types/{lib/ReanimatedEventEmitter.d.ts → ReanimatedEventEmitter.d.ts} +0 -0
  83. package/lib/types/{lib/ReanimatedModule.d.ts → ReanimatedModule.d.ts} +0 -0
  84. package/lib/types/{lib/ReanimatedModule.macos.d.ts → ReanimatedModule.macos.d.ts} +0 -0
  85. package/lib/types/{lib/ReanimatedModule.native.d.ts → ReanimatedModule.native.d.ts} +0 -0
  86. package/lib/types/{lib/ReanimatedModule.windows.d.ts → ReanimatedModule.windows.d.ts} +0 -0
  87. package/lib/types/{lib/ReanimatedModuleCompat.d.ts → ReanimatedModuleCompat.d.ts} +0 -0
  88. package/lib/types/{lib/createAnimatedComponent.d.ts → createAnimatedComponent.d.ts} +0 -0
  89. package/lib/types/index.d.ts +4 -0
  90. package/lib/types/index.web.d.ts +3 -0
  91. package/lib/types/{lib/reanimated2 → reanimated2}/Bezier.d.ts +0 -0
  92. package/lib/types/{lib/reanimated2 → reanimated2}/Colors.d.ts +0 -0
  93. package/lib/types/{lib/reanimated2 → reanimated2}/Easing.d.ts +0 -0
  94. package/lib/types/{lib/reanimated2 → reanimated2}/NativeMethods.d.ts +0 -0
  95. package/lib/types/{lib/reanimated2 → reanimated2}/NativeReanimated/NativeReanimated.d.ts +3 -1
  96. package/lib/types/{lib/reanimated2 → reanimated2}/NativeReanimated/index.d.ts +0 -0
  97. package/lib/types/{lib/reanimated2 → reanimated2}/PlatformChecker.d.ts +0 -0
  98. package/lib/types/{lib/reanimated2 → reanimated2}/PropAdapters.d.ts +0 -0
  99. package/lib/types/{lib/reanimated2 → reanimated2}/UpdateProps.d.ts +0 -0
  100. package/lib/types/{lib/reanimated2 → reanimated2}/ViewDescriptorsSet.d.ts +0 -0
  101. package/lib/types/{lib/reanimated2 → reanimated2}/WorkletEventHandler.d.ts +0 -0
  102. package/lib/types/{lib/reanimated2 → reanimated2}/__mocks__/MutableValue.d.ts +0 -0
  103. package/lib/types/{lib/reanimated2 → reanimated2}/__mocks__/NativeReanimated.d.ts +0 -0
  104. package/lib/types/{lib/reanimated2 → reanimated2}/__mocks__/NativeReanimated.native.d.ts +0 -0
  105. package/lib/types/{lib/reanimated2 → reanimated2}/animation/commonTypes.d.ts +0 -0
  106. package/lib/types/{lib/reanimated2 → reanimated2}/animation/decay.d.ts +0 -0
  107. package/lib/types/{lib/reanimated2 → reanimated2}/animation/delay.d.ts +0 -0
  108. package/lib/types/{lib/reanimated2 → reanimated2}/animation/index.d.ts +0 -0
  109. package/lib/types/{lib/reanimated2 → reanimated2}/animation/repeat.d.ts +0 -0
  110. package/lib/types/{lib/reanimated2 → reanimated2}/animation/sequence.d.ts +0 -0
  111. package/lib/types/{lib/reanimated2 → reanimated2}/animation/spring.d.ts +0 -0
  112. package/lib/types/{lib/reanimated2 → reanimated2}/animation/styleAnimation.d.ts +0 -0
  113. package/lib/types/{lib/reanimated2 → reanimated2}/animation/timing.d.ts +0 -0
  114. package/lib/types/{lib/reanimated2 → reanimated2}/animation/util.d.ts +0 -0
  115. package/lib/types/{lib/reanimated2 → reanimated2}/commonTypes.d.ts +12 -0
  116. package/lib/types/{lib/reanimated2 → reanimated2}/component/FlatList.d.ts +2 -2
  117. package/lib/types/reanimated2/component/Image.d.ts +3 -0
  118. package/lib/types/reanimated2/component/ScrollView.d.ts +3 -0
  119. package/lib/types/reanimated2/component/Text.d.ts +3 -0
  120. package/lib/types/reanimated2/component/View.d.ts +3 -0
  121. package/lib/types/{lib/reanimated2 → reanimated2}/core.d.ts +0 -0
  122. package/lib/types/reanimated2/frameCallback/FrameCallbackRegistryJS.d.ts +7 -0
  123. package/lib/types/reanimated2/frameCallback/FrameCallbackRegistryUI.d.ts +10 -0
  124. package/lib/types/{lib/reanimated2 → reanimated2}/hook/Hooks.d.ts +0 -0
  125. package/lib/types/{lib/reanimated2 → reanimated2}/hook/commonTypes.d.ts +0 -0
  126. package/lib/types/{lib/reanimated2 → reanimated2}/hook/index.d.ts +3 -0
  127. package/lib/types/{lib/reanimated2 → reanimated2}/hook/useAnimatedGestureHandler.d.ts +0 -0
  128. package/lib/types/reanimated2/hook/useAnimatedKeyboard.d.ts +2 -0
  129. package/lib/types/{lib/reanimated2 → reanimated2}/hook/useAnimatedReaction.d.ts +0 -0
  130. package/lib/types/{lib/reanimated2 → reanimated2}/hook/useAnimatedRef.d.ts +0 -0
  131. package/lib/types/{lib/reanimated2 → reanimated2}/hook/useAnimatedScrollHandler.d.ts +0 -0
  132. package/lib/types/{lib/reanimated2 → reanimated2}/hook/useAnimatedSensor.d.ts +1 -1
  133. package/lib/types/{lib/reanimated2 → reanimated2}/hook/useAnimatedStyle.d.ts +0 -0
  134. package/lib/types/{lib/reanimated2 → reanimated2}/hook/useDerivedValue.d.ts +0 -0
  135. package/lib/types/reanimated2/hook/useFrameCallback.d.ts +6 -0
  136. package/lib/types/{lib/reanimated2 → reanimated2}/hook/useSharedValue.d.ts +0 -0
  137. package/lib/types/{lib/reanimated2 → reanimated2}/hook/utils.d.ts +0 -0
  138. package/lib/types/{lib/reanimated2 → reanimated2}/index.d.ts +0 -0
  139. package/lib/types/{lib/reanimated2 → reanimated2}/interpolateColor.d.ts +0 -0
  140. package/lib/types/{lib/reanimated2 → reanimated2}/interpolation.d.ts +0 -0
  141. package/lib/types/{lib/reanimated2 → reanimated2}/jestUtils.d.ts +1 -1
  142. package/lib/types/{lib/reanimated2 → reanimated2}/js-reanimated/JSReanimated.d.ts +3 -1
  143. package/lib/types/{lib/reanimated2 → reanimated2}/js-reanimated/Mapper.d.ts +0 -0
  144. package/lib/types/{lib/reanimated2 → reanimated2}/js-reanimated/MapperRegistry.d.ts +0 -0
  145. package/lib/types/{lib/reanimated2 → reanimated2}/js-reanimated/MutableValue.d.ts +0 -0
  146. package/lib/types/{lib/reanimated2 → reanimated2}/js-reanimated/commonTypes.d.ts +0 -0
  147. package/lib/types/reanimated2/js-reanimated/global.d.ts +2 -0
  148. package/lib/types/{lib/reanimated2 → reanimated2}/js-reanimated/index.d.ts +0 -0
  149. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/LayoutAnimationRepository.d.ts +0 -0
  150. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/animationBuilder/BaseAnimationBuilder.d.ts +0 -0
  151. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/animationBuilder/ComplexAnimationBuilder.d.ts +0 -0
  152. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/animationBuilder/Keyframe.d.ts +0 -0
  153. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/animationBuilder/commonTypes.d.ts +0 -0
  154. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/animationBuilder/index.d.ts +0 -0
  155. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Bounce.d.ts +0 -0
  156. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Default.d.ts +0 -0
  157. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Fade.d.ts +0 -0
  158. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Flip.d.ts +0 -0
  159. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Lightspeed.d.ts +0 -0
  160. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Pinwheel.d.ts +0 -0
  161. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Roll.d.ts +0 -0
  162. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Rotate.d.ts +0 -0
  163. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Slide.d.ts +0 -0
  164. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Stretch.d.ts +0 -0
  165. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Zoom.d.ts +0 -0
  166. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/index.d.ts +0 -0
  167. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultTransitions/CurvedTransition.d.ts +0 -0
  168. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultTransitions/EntryExitTransition.d.ts +0 -0
  169. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultTransitions/FadingTransition.d.ts +0 -0
  170. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultTransitions/JumpingTransition.d.ts +0 -0
  171. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultTransitions/LinearTransition.d.ts +0 -0
  172. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultTransitions/SequencedTransition.d.ts +0 -0
  173. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultTransitions/index.d.ts +0 -0
  174. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/index.d.ts +0 -0
  175. package/lib/types/{lib/reanimated2 → reanimated2}/mock.d.ts +6 -0
  176. package/lib/types/{lib/reanimated2 → reanimated2}/platform-specific/RNRenderer.d.ts +0 -0
  177. package/lib/types/reanimated2/platform-specific/RNRenderer.web.d.ts +0 -0
  178. package/lib/types/{lib/reanimated2 → reanimated2}/utils.d.ts +0 -0
  179. package/lib/types/{lib/setAndForwardRef.d.ts → setAndForwardRef.d.ts} +0 -0
  180. package/mock.js +1 -0
  181. package/package.json +15 -10
  182. package/plugin.js +7 -6
  183. package/react-native-reanimated.d.ts +56 -8
  184. package/src/Animated.ts +13 -0
  185. package/src/index.ts +15 -0
  186. package/src/index.web.ts +5 -0
  187. package/src/reanimated2/Colors.ts +1 -1
  188. package/src/reanimated2/NativeMethods.ts +5 -0
  189. package/src/reanimated2/NativeReanimated/NativeReanimated.ts +10 -1
  190. package/src/reanimated2/animation/sequence.ts +0 -5
  191. package/src/reanimated2/animation/util.ts +8 -1
  192. package/src/reanimated2/commonTypes.ts +15 -0
  193. package/src/reanimated2/component/FlatList.tsx +32 -25
  194. package/src/reanimated2/component/Image.ts +6 -0
  195. package/src/reanimated2/component/ScrollView.ts +6 -0
  196. package/src/reanimated2/component/Text.ts +6 -0
  197. package/src/reanimated2/component/View.ts +6 -0
  198. package/src/reanimated2/core.ts +8 -13
  199. package/src/reanimated2/frameCallback/FrameCallbackRegistryJS.ts +43 -0
  200. package/src/reanimated2/frameCallback/FrameCallbackRegistryUI.ts +64 -0
  201. package/src/reanimated2/globals.d.ts +3 -0
  202. package/src/reanimated2/hook/index.ts +3 -0
  203. package/src/reanimated2/hook/useAnimatedKeyboard.ts +35 -0
  204. package/src/reanimated2/hook/useAnimatedSensor.ts +5 -5
  205. package/src/reanimated2/hook/useFrameCallback.ts +39 -0
  206. package/src/reanimated2/hook/utils.ts +0 -6
  207. package/src/reanimated2/jestUtils.ts +11 -3
  208. package/src/reanimated2/js-reanimated/JSReanimated.ts +16 -1
  209. package/src/reanimated2/js-reanimated/global.ts +45 -0
  210. package/src/reanimated2/js-reanimated/index.ts +0 -31
  211. package/src/reanimated2/layoutReanimation/LayoutAnimationRepository.ts +1 -1
  212. package/src/reanimated2/mock.ts +6 -0
  213. package/android/react-native-reanimated-64-hermes.aar +0 -0
  214. package/android/react-native-reanimated-64-jsc.aar +0 -0
  215. package/android/react-native-reanimated-65-hermes.aar +0 -0
  216. package/android/react-native-reanimated-65-jsc.aar +0 -0
  217. package/lib/reanimated2/component/WrappedComponents.js +0 -9
  218. package/lib/reanimated2/component/index.js +0 -4
  219. package/lib/types/lib/reanimated2/component/WrappedComponents.d.ts +0 -8
  220. package/lib/types/lib/reanimated2/component/index.d.ts +0 -9
  221. package/lib/types/react-native-reanimated-tests.d.ts +0 -1
  222. package/src/Animated.js +0 -22
  223. package/src/reanimated2/component/WrappedComponents.ts +0 -11
  224. package/src/reanimated2/component/index.ts +0 -9
@@ -1,8 +1,15 @@
1
- cmake_minimum_required(VERSION 3.5.1)
1
+ project(Reanimated)
2
+ cmake_minimum_required(VERSION 3.12.0)
2
3
 
3
4
  set (CMAKE_VERBOSE_MAKEFILE ON)
4
- set (CMAKE_CXX_STANDARD 14)
5
- set (CMAKE_CXX_FLAGS "-DFOLLY_NO_CONFIG=1 -DFOLLY_HAVE_CLOCK_GETTIME=1 -DFOLLY_HAVE_MEMRCHR=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_MOBILE=1 -DON_ANDROID -DONANDROID -DFOR_HERMES=${FOR_HERMES} -fexceptions -fno-omit-frame-pointer -frtti -Wno-sign-compare")
5
+ set (CMAKE_CXX_STANDARD 17)
6
+ set (DEFAULT_FLAGS "-DFOLLY_NO_CONFIG=1 -DFOLLY_HAVE_CLOCK_GETTIME=1 -DFOLLY_HAVE_MEMRCHR=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_MOBILE=1 -DFOLLY_HAVE_RECVMMSG=1 -DFOLLY_HAVE_PTHREAD=1 -DON_ANDROID -DONANDROID -DANDROID -DRNVERSION=${RNVERSION} -fexceptions -fno-omit-frame-pointer -frtti -Wno-sign-compare -std=c++17 -Wall")
7
+ if(${IS_NEW_ARCHITECTURE_ENABLED})
8
+ set (ALL_FLAGS "${DEFAULT_FLAGS} -DRCT_NEW_ARCH_ENABLED")
9
+ else()
10
+ set (ALL_FLAGS ${DEFAULT_FLAGS})
11
+ endif()
12
+ set (CMAKE_CXX_FLAGS ${ALL_FLAGS})
6
13
 
7
14
  if(${NATIVE_DEBUG})
8
15
  set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g")
@@ -13,56 +20,66 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
13
20
  set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE INTERNAL "")
14
21
 
15
22
  set (PACKAGE_NAME "reanimated")
23
+ set (BUILD_DIR ${CMAKE_SOURCE_DIR}/build)
16
24
  set (SRC_DIR ${CMAKE_SOURCE_DIR}/src)
17
25
 
26
+ set (ignoreMe "${PLAYGROUND_APP_NAME}")
27
+
18
28
  if(${CLIENT_SIDE_BUILD})
19
- set (NODE_MODULES_DIR "${CMAKE_SOURCE_DIR}/../../")
20
29
  set (COMMON_SRC_DIR "${CMAKE_SOURCE_DIR}/../Common")
21
30
  else()
22
- set (NODE_MODULES_DIR "../node_modules")
23
31
  set (COMMON_SRC_DIR "${SRC_DIR}/main/Common")
24
32
  endif()
25
33
 
26
- set (RN_SO_DIR ${NODE_MODULES_DIR}/react-native/ReactAndroid/src/main/jni/first-party/react/jni)
27
- set (FBJNI_HEADERS_DIR ${RN_SO_DIR}/../../fbjni/headers)
34
+ if(${IS_NEW_ARCHITECTURE_ENABLED})
35
+ if(${CLIENT_SIDE_BUILD})
36
+ set (RN_SO_DIR "${CMAKE_SOURCE_DIR}/../../../android/app/build/react-ndk/exported")
37
+ set (FBJNI_HEADERS_DIR "${CMAKE_SOURCE_DIR}/../../react-native/ReactAndroid/src/main/jni/first-party/fbjni/headers")
38
+ else()
39
+ set (RN_SO_DIR "${CMAKE_SOURCE_DIR}/../${PLAYGROUND_APP_NAME}/android/app/build/react-ndk/exported")
40
+ set (FBJNI_HEADERS_DIR "${CMAKE_SOURCE_DIR}/../${PLAYGROUND_APP_NAME}/node_modules/react-native/ReactAndroid/src/main/jni/first-party/fbjni/headers")
41
+ endif()
42
+ else()
43
+ set (RN_SO_DIR ${NODE_MODULES_DIR}/react-native/ReactAndroid/src/main/jni/first-party/react/jni)
44
+ set (FBJNI_HEADERS_DIR "${NODE_MODULES_DIR}/react-native/ReactAndroid/src/main/jni/first-party/fbjni/headers")
45
+ endif()
28
46
 
29
- # reanimated shared
47
+ file (GLOB LIBRN_DIR "${RN_SO_DIR}/${ANDROID_ABI}")
30
48
 
31
- file(GLOB sources_tools "${COMMON_SRC_DIR}/cpp/Tools/*.cpp")
32
- file(GLOB sources_native_modules "${COMMON_SRC_DIR}/cpp/NativeModules/*.cpp")
33
- file(GLOB sources_shared_items "${COMMON_SRC_DIR}/cpp/SharedItems/*.cpp")
34
- file(GLOB sources_registries "${COMMON_SRC_DIR}/cpp/Registries/*.cpp")
35
- file(GLOB sources_android "${SRC_DIR}/main/cpp/*.cpp")
49
+ file(GLOB_RECURSE SOURCES_COMMON CONFIGURE_DEPENDS "${COMMON_SRC_DIR}/cpp/**.cpp")
50
+ file(GLOB_RECURSE SOURCES_ANDROID CONFIGURE_DEPENDS "${SRC_DIR}/main/cpp/**.cpp")
36
51
 
37
52
  if(${REACT_NATIVE_TARGET_VERSION} LESS 66)
38
- set (
39
- INCLUDE_JSI_CPP
40
- "${NODE_MODULES_DIR}/react-native/ReactCommon/jsi/jsi/jsi.cpp"
41
- )
42
- set (
43
- INCLUDE_JSIDYNAMIC_CPP
44
- "${NODE_MODULES_DIR}/react-native/ReactCommon/jsi/jsi/JSIDynamic.cpp"
45
- )
53
+ set (
54
+ INCLUDE_JSI_CPP
55
+ "${NODE_MODULES_DIR}/react-native/ReactCommon/jsi/jsi/jsi.cpp"
56
+ )
57
+ set (
58
+ INCLUDE_JSIDYNAMIC_CPP
59
+ "${NODE_MODULES_DIR}/react-native/ReactCommon/jsi/jsi/JSIDynamic.cpp"
60
+ )
61
+ endif()
62
+
63
+ if(${IS_NEW_ARCHITECTURE_ENABLED})
64
+ set(
65
+ FABRIC_UTILS_CPP
66
+ "${COMMON_SRC_DIR}/cpp/Fabric/FabricUtils.cpp"
67
+ )
68
+ set(
69
+ REANIMATED_UI_MANAGER_BINDING_CPP
70
+ "${COMMON_SRC_DIR}/cpp/Fabric/ReanimatedUIManagerBinding.cpp"
71
+ )
46
72
  endif()
47
73
 
48
74
  add_library(
49
75
  ${PACKAGE_NAME}
50
76
  SHARED
51
- ${sources_native_modules}
52
- ${sources_shared_items}
53
- ${sources_registries}
54
- ${sources_android}
55
- ${source_tools}
77
+ ${SOURCES_COMMON}
78
+ ${SOURCES_ANDROID}
56
79
  ${INCLUDE_JSI_CPP}
57
80
  ${INCLUDE_JSIDYNAMIC_CPP}
58
- "${COMMON_SRC_DIR}/cpp/Tools/JSIStoreValueUser.cpp"
59
- "${COMMON_SRC_DIR}/cpp/Tools/Mapper.cpp"
60
- "${COMMON_SRC_DIR}/cpp/Tools/RuntimeDecorator.cpp"
61
- "${COMMON_SRC_DIR}/cpp/Tools/Scheduler.cpp"
62
- "${COMMON_SRC_DIR}/cpp/Tools/WorkletEventHandler.cpp"
63
- "${COMMON_SRC_DIR}/cpp/Tools/FeaturesConfig.cpp"
64
- "${COMMON_SRC_DIR}/cpp/LayoutAnimations/LayoutAnimationsProxy.cpp"
65
- "${COMMON_SRC_DIR}/cpp/AnimatedSensor/AnimatedSensorModule.cpp"
81
+ ${FABRIC_UTILS_CPP}
82
+ ${REANIMATED_UI_MANAGER_BINDING_CPP}
66
83
  )
67
84
 
68
85
  # includes
@@ -81,12 +98,15 @@ target_include_directories(
81
98
  "${NODE_MODULES_DIR}/react-native/React/Base"
82
99
  "${NODE_MODULES_DIR}/react-native/ReactAndroid/src/main/jni"
83
100
  "${NODE_MODULES_DIR}/react-native/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni"
101
+ "${NODE_MODULES_DIR}/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/jni"
84
102
  "${NODE_MODULES_DIR}/react-native/ReactCommon"
85
103
  "${NODE_MODULES_DIR}/react-native/ReactCommon/callinvoker"
86
104
  "${NODE_MODULES_DIR}/react-native/ReactCommon/jsi"
105
+ "${NODE_MODULES_DIR}/react-native/ReactCommon/react/renderer/graphics/platform/cxx"
106
+ "${NODE_MODULES_DIR}/react-native/ReactCommon/runtimeexecutor"
87
107
  "${NODE_MODULES_DIR}/react-native/ReactCommon/turbomodule/core"
88
108
  "${NODE_MODULES_DIR}/react-native/ReactCommon/turbomodule"
89
- "${NODE_MODULES_DIR}/hermes-engine/android/include/"
109
+ "${NODE_MODULES_DIR}/react-native/ReactCommon/yoga"
90
110
  "${COMMON_SRC_DIR}/cpp/headers/Tools"
91
111
  "${COMMON_SRC_DIR}/cpp/headers/SpecTools"
92
112
  "${COMMON_SRC_DIR}/cpp/headers/NativeModules"
@@ -94,51 +114,27 @@ target_include_directories(
94
114
  "${COMMON_SRC_DIR}/cpp/headers/Registries"
95
115
  "${COMMON_SRC_DIR}/cpp/headers/LayoutAnimations"
96
116
  "${COMMON_SRC_DIR}/cpp/headers/AnimatedSensor"
117
+ "${COMMON_SRC_DIR}/cpp/headers/Fabric"
97
118
  "${COMMON_SRC_DIR}/cpp/hidden_headers"
98
119
  "${SRC_DIR}/main/cpp/headers"
99
120
  )
100
121
 
101
- # find libraries
102
-
103
- file (GLOB LIBRN_DIR "${RN_SO_DIR}/${ANDROID_ABI}")
104
- file (GLOB HERMES_DIR "${BUILD_DIR}/third-party-ndk/hermes/jni/${ANDROID_ABI}")
105
-
106
122
  find_library(
107
123
  LOG_LIB
108
124
  log
109
125
  )
110
- find_library(
111
- HERMES_LIB
112
- hermes
113
- PATHS ${HERMES_DIR}
114
- NO_CMAKE_FIND_ROOT_PATH
115
- )
116
- find_library(
117
- JSEXECUTOR_LIB
118
- jscexecutor
119
- PATHS ${LIBRN_DIR}
120
- NO_CMAKE_FIND_ROOT_PATH
121
- )
122
- find_library(
123
- FOLLY_JSON_LIB
124
- folly_json
125
- PATHS ${LIBRN_DIR}
126
- NO_CMAKE_FIND_ROOT_PATH
127
- )
128
126
  find_library(
129
127
  REACT_NATIVE_JNI_LIB
130
128
  reactnativejni
131
129
  PATHS ${LIBRN_DIR}
132
130
  NO_CMAKE_FIND_ROOT_PATH
133
131
  )
134
-
135
132
  find_library(
136
133
  GLOG_LIB
137
134
  glog
138
135
  PATHS ${LIBRN_DIR}
139
136
  NO_CMAKE_FIND_ROOT_PATH
140
137
  )
141
-
142
138
  find_library(
143
139
  FBJNI_LIB
144
140
  fbjni
@@ -146,44 +142,180 @@ find_library(
146
142
  NO_CMAKE_FIND_ROOT_PATH
147
143
  )
148
144
 
145
+ if(${REACT_NATIVE_TARGET_VERSION} LESS 69)
146
+ find_library(
147
+ FOLLY_LIB
148
+ folly_json
149
+ PATHS ${LIBRN_DIR}
150
+ NO_CMAKE_FIND_ROOT_PATH
151
+ )
152
+ else()
153
+ find_library(
154
+ FOLLY_LIB
155
+ folly_runtime
156
+ PATHS ${LIBRN_DIR}
157
+ NO_CMAKE_FIND_ROOT_PATH
158
+ )
159
+ endif()
160
+
149
161
  if(${REACT_NATIVE_TARGET_VERSION} LESS 66)
150
- set (JSI_LIB "")
162
+ set (JSI_LIB "")
151
163
  else()
152
- find_library(
153
- JSI_LIB
154
- jsi
155
- PATHS ${LIBRN_DIR}
156
- NO_CMAKE_FIND_ROOT_PATH
157
- )
164
+ find_library(
165
+ JSI_LIB
166
+ jsi
167
+ PATHS ${LIBRN_DIR}
168
+ NO_CMAKE_FIND_ROOT_PATH
169
+ )
170
+ endif()
171
+
172
+ if(${IS_NEW_ARCHITECTURE_ENABLED})
173
+ find_library(
174
+ REACT_RENDER_UIMANAGER
175
+ react_render_uimanager
176
+ PATHS ${LIBRN_DIR}
177
+ NO_CMAKE_FIND_ROOT_PATH
178
+ )
179
+ find_library(
180
+ REACT_RENDER_MOUNTING
181
+ react_render_mounting
182
+ PATHS ${LIBRN_DIR}
183
+ NO_CMAKE_FIND_ROOT_PATH
184
+ )
185
+ find_library(
186
+ REACT_RENDER_COMPONENTREGISTRY
187
+ react_render_componentregistry
188
+ PATHS ${LIBRN_DIR}
189
+ NO_CMAKE_FIND_ROOT_PATH
190
+ )
191
+ find_library(
192
+ REACT_RENDER_CORE
193
+ react_render_core
194
+ PATHS ${LIBRN_DIR}
195
+ NO_CMAKE_FIND_ROOT_PATH
196
+ )
197
+ find_library(
198
+ REACT_DEBUG
199
+ react_debug
200
+ PATHS ${LIBRN_DIR}
201
+ NO_CMAKE_FIND_ROOT_PATH
202
+ )
203
+ find_library(
204
+ REACT_RENDER_DEBUG
205
+ react_render_debug
206
+ PATHS ${LIBRN_DIR}
207
+ NO_CMAKE_FIND_ROOT_PATH
208
+ )
209
+ find_library(
210
+ RRC_ROOT
211
+ rrc_root
212
+ PATHS ${LIBRN_DIR}
213
+ NO_CMAKE_FIND_ROOT_PATH
214
+ )
215
+ find_library(
216
+ RRC_VIEW
217
+ rrc_view
218
+ PATHS ${LIBRN_DIR}
219
+ NO_CMAKE_FIND_ROOT_PATH
220
+ )
221
+ find_library(
222
+ REACT_RENDER_SCHEDULER
223
+ react_render_scheduler
224
+ PATHS ${LIBRN_DIR}
225
+ NO_CMAKE_FIND_ROOT_PATH
226
+ )
227
+ find_library(
228
+ FABRICJNI
229
+ fabricjni
230
+ PATHS ${LIBRN_DIR}
231
+ NO_CMAKE_FIND_ROOT_PATH
232
+ )
158
233
  endif()
159
234
 
160
235
  # build shared lib
161
236
 
162
237
  set_target_properties(${PACKAGE_NAME} PROPERTIES LINKER_LANGUAGE CXX)
163
238
 
164
- if(${FOR_HERMES})
239
+
240
+ target_link_libraries(
241
+ ${PACKAGE_NAME}
242
+ ${LOG_LIB}
243
+ ${JSI_LIB}
244
+ ${GLOG_LIB}
245
+ ${FBJNI_LIB}
246
+ ${FOLLY_LIB}
247
+ ${REACT_NATIVE_JNI_LIB}
248
+ android
249
+ )
250
+
251
+ if(${JS_RUNTIME} STREQUAL "hermes")
252
+ string(APPEND CMAKE_CXX_FLAGS " -DJS_RUNTIME_HERMES=1")
253
+ if(${REACT_NATIVE_TARGET_VERSION} LESS 69)
254
+ # From `hermes-engine` npm package
255
+ target_include_directories(
256
+ ${PACKAGE_NAME}
257
+ PRIVATE
258
+ "${JS_RUNTIME_DIR}/android/include"
259
+ )
260
+ else()
261
+ # Bundled Hermes from module `com.facebook.react:hermes-engine` or project `:ReactAndroid:hermes-engine`
262
+ target_include_directories(
263
+ ${PACKAGE_NAME}
264
+ PRIVATE
265
+ "${JS_RUNTIME_DIR}/API"
266
+ "${JS_RUNTIME_DIR}/public"
267
+ )
268
+ endif()
165
269
  target_link_libraries(
166
270
  ${PACKAGE_NAME}
167
- ${LOG_LIB}
168
- ${JSI_LIB}
169
- ${HERMES_LIB}
170
- ${GLOG_LIB}
171
- ${FBJNI_LIB}
172
- ${FOLLY_JSON_LIB}
173
- ${REACT_NATIVE_JNI_LIB}
174
- android
271
+ "${BUILD_DIR}/third-party-ndk/hermes/jni/${ANDROID_ABI}/libhermes.so"
272
+ )
273
+ elseif(${JS_RUNTIME} STREQUAL "v8")
274
+ string(APPEND CMAKE_CXX_FLAGS " -DJS_RUNTIME_V8=1")
275
+ target_include_directories(
276
+ ${PACKAGE_NAME}
277
+ PRIVATE
278
+ "${JS_RUNTIME_DIR}/src"
279
+ )
280
+ file (GLOB V8_SO_DIR "${JS_RUNTIME_DIR}/android/build/intermediates/library_jni/*/jni/${ANDROID_ABI}")
281
+ find_library(
282
+ V8EXECUTOR_LIB
283
+ v8executor
284
+ PATHS ${V8_SO_DIR}
285
+ NO_CMAKE_FIND_ROOT_PATH
286
+ )
287
+ target_link_libraries(
288
+ ${PACKAGE_NAME}
289
+ ${V8EXECUTOR_LIB}
175
290
  )
176
291
  else()
292
+ set (ignoreMe "${JS_RUNTIME_DIR}")
293
+ string(APPEND CMAKE_CXX_FLAGS " -DJS_RUNTIME_JSC=1")
294
+ find_library(
295
+ JSEXECUTOR_LIB
296
+ jscexecutor
297
+ PATHS ${LIBRN_DIR}
298
+ NO_CMAKE_FIND_ROOT_PATH
299
+ )
177
300
  target_link_libraries(
178
301
  ${PACKAGE_NAME}
179
- ${LOG_LIB}
180
- ${JSI_LIB}
181
302
  ${JSEXECUTOR_LIB}
182
- ${GLOG_LIB}
183
- ${FBJNI_LIB}
184
- ${FOLLY_JSON_LIB}
185
- ${REACT_NATIVE_JNI_LIB}
186
- android
303
+ )
304
+ endif()
305
+
306
+ if(${IS_NEW_ARCHITECTURE_ENABLED})
307
+ target_link_libraries(
308
+ ${PACKAGE_NAME}
309
+ ${REACT_RENDER_UIMANAGER}
310
+ ${REACT_RENDER_MOUNTING}
311
+ ${REACT_RENDER_COMPONENTREGISTRY}
312
+ ${REACT_RENDER_CORE}
313
+ ${REACT_DEBUG}
314
+ ${REACT_RENDER_DEBUG}
315
+ ${RRC_ROOT}
316
+ ${RRC_VIEW}
317
+ ${FABRICJNI}
318
+ ${REACT_RENDER_SCHEDULER}
187
319
  )
188
320
  endif()
189
321
 
@@ -195,4 +327,4 @@ if(${REACT_NATIVE_TARGET_VERSION} LESS 64)
195
327
  # Provides a relative path to your source file(s).
196
328
  ./empty.cpp
197
329
  )
198
- endif()
330
+ endif()