react-native-reanimated 2.8.0 → 3.0.0-rc.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 (381) hide show
  1. package/Common/cpp/Fabric/FabricUtils.cpp +128 -0
  2. package/Common/cpp/Fabric/ReanimatedUIManagerBinding.cpp +197 -0
  3. package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +311 -6
  4. package/Common/cpp/Registries/EventHandlerRegistry.cpp +14 -1
  5. package/Common/cpp/Registries/NewestShadowNodesRegistry.cpp +68 -0
  6. package/Common/cpp/SharedItems/ShareableValue.cpp +18 -0
  7. package/Common/cpp/Tools/Mapper.cpp +23 -4
  8. package/Common/cpp/Tools/RuntimeDecorator.cpp +92 -32
  9. package/Common/cpp/Tools/Scheduler.cpp +4 -0
  10. package/Common/cpp/headers/Fabric/FabricUtils.h +78 -0
  11. package/Common/cpp/headers/Fabric/ReanimatedUIManagerBinding.h +46 -0
  12. package/Common/cpp/headers/NativeModules/NativeReanimatedModule.h +72 -2
  13. package/Common/cpp/headers/Registries/EventHandlerRegistry.h +8 -0
  14. package/Common/cpp/headers/Registries/NewestShadowNodesRegistry.h +41 -0
  15. package/Common/cpp/headers/SharedItems/SharedParent.h +3 -0
  16. package/Common/cpp/headers/SharedItems/ValueWrapper.h +25 -0
  17. package/Common/cpp/headers/SpecTools/ErrorHandler.h +5 -0
  18. package/Common/cpp/headers/Tools/Mapper.h +1 -1
  19. package/Common/cpp/headers/Tools/PlatformDepMethodsHolder.h +43 -8
  20. package/Common/cpp/headers/Tools/RuntimeDecorator.h +8 -3
  21. package/README.md +4 -0
  22. package/RNReanimated.podspec +22 -11
  23. package/android/CMakeLists.txt +139 -27
  24. package/android/build.gradle +86 -209
  25. package/android/local.properties +1 -0
  26. package/android/src/fabric/java/com/swmansion/reanimated/NativeProxy.java +310 -0
  27. package/android/src/fabric/java/com/swmansion/reanimated/ReaCompatibility.java +25 -0
  28. package/android/src/main/cpp/NativeProxy.cpp +178 -33
  29. package/android/src/main/cpp/headers/NativeProxy.h +43 -7
  30. package/android/src/main/java/com/swmansion/reanimated/NodesManager.java +13 -245
  31. package/android/src/main/java/com/swmansion/reanimated/ReanimatedModule.java +0 -125
  32. package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/LayoutAnimations.java +2 -1
  33. package/android/src/{main → paper}/java/com/swmansion/reanimated/NativeProxy.java +15 -2
  34. package/android/src/paper/java/com/swmansion/reanimated/ReaCompatibility.java +17 -0
  35. package/ios/Fabric/REAInitializerRCTFabricSurface.h +12 -0
  36. package/ios/Fabric/REAInitializerRCTFabricSurface.mm +73 -0
  37. package/ios/REAEventDispatcher.m +0 -1
  38. package/ios/REAModule.h +10 -1
  39. package/ios/REAModule.mm +284 -0
  40. package/ios/REANodesManager.h +27 -51
  41. package/ios/{REANodesManager.m → REANodesManager.mm} +91 -223
  42. package/ios/native/NativeProxy.mm +144 -17
  43. package/ios/native/REAInitializer.mm +12 -4
  44. package/ios/native/UIResponder+Reanimated.h +3 -1
  45. package/ios/native/UIResponder+Reanimated.mm +3 -1
  46. package/lib/Animated.js +0 -4
  47. package/lib/createAnimatedComponent.js +30 -169
  48. package/lib/index.js +0 -4
  49. package/lib/reanimated2/Easing.js +0 -42
  50. package/lib/reanimated2/NativeMethods.js +20 -3
  51. package/lib/reanimated2/UpdateProps.js +25 -10
  52. package/lib/reanimated2/core.js +4 -1
  53. package/lib/reanimated2/fabricUtils.js +18 -0
  54. package/lib/reanimated2/globals.d.ts +17 -1
  55. package/lib/reanimated2/hook/useAnimatedRef.js +6 -2
  56. package/lib/reanimated2/hook/utils.js +0 -5
  57. package/lib/reanimated2/interpolateColor.js +5 -2
  58. package/lib/reanimated2/interpolation.js +0 -15
  59. package/lib/reanimated2/js-reanimated/index.js +3 -0
  60. package/lib/types/{lib/ConfigHelper.d.ts → ConfigHelper.d.ts} +0 -0
  61. package/lib/types/{lib/ReanimatedEventEmitter.d.ts → ReanimatedEventEmitter.d.ts} +0 -0
  62. package/lib/types/{lib/ReanimatedModule.d.ts → ReanimatedModule.d.ts} +0 -0
  63. package/lib/types/{lib/ReanimatedModule.macos.d.ts → ReanimatedModule.macos.d.ts} +0 -0
  64. package/lib/types/{lib/ReanimatedModule.native.d.ts → ReanimatedModule.native.d.ts} +0 -0
  65. package/lib/types/{lib/ReanimatedModule.windows.d.ts → ReanimatedModule.windows.d.ts} +0 -0
  66. package/lib/types/{lib/ReanimatedModuleCompat.d.ts → ReanimatedModuleCompat.d.ts} +0 -0
  67. package/lib/types/{lib/createAnimatedComponent.d.ts → createAnimatedComponent.d.ts} +0 -0
  68. package/lib/types/{lib/reanimated2 → reanimated2}/Bezier.d.ts +0 -0
  69. package/lib/types/{lib/reanimated2 → reanimated2}/Colors.d.ts +0 -0
  70. package/lib/types/{lib/reanimated2 → reanimated2}/Easing.d.ts +0 -0
  71. package/lib/types/{lib/reanimated2 → reanimated2}/NativeMethods.d.ts +2 -1
  72. package/lib/types/{lib/reanimated2 → reanimated2}/NativeReanimated/NativeReanimated.d.ts +0 -0
  73. package/lib/types/{lib/reanimated2 → reanimated2}/NativeReanimated/index.d.ts +0 -0
  74. package/lib/types/{lib/reanimated2 → reanimated2}/PlatformChecker.d.ts +0 -0
  75. package/lib/types/{lib/reanimated2 → reanimated2}/PropAdapters.d.ts +0 -0
  76. package/lib/types/{lib/reanimated2 → reanimated2}/UpdateProps.d.ts +0 -0
  77. package/lib/types/{lib/reanimated2 → reanimated2}/ViewDescriptorsSet.d.ts +0 -0
  78. package/lib/types/{lib/reanimated2 → reanimated2}/WorkletEventHandler.d.ts +0 -0
  79. package/lib/types/{lib/reanimated2 → reanimated2}/__mocks__/MutableValue.d.ts +0 -0
  80. package/lib/types/{lib/reanimated2 → reanimated2}/__mocks__/NativeReanimated.d.ts +0 -0
  81. package/lib/types/{lib/reanimated2 → reanimated2}/__mocks__/NativeReanimated.native.d.ts +0 -0
  82. package/lib/types/{lib/reanimated2 → reanimated2}/animation/commonTypes.d.ts +0 -0
  83. package/lib/types/{lib/reanimated2 → reanimated2}/animation/decay.d.ts +0 -0
  84. package/lib/types/{lib/reanimated2 → reanimated2}/animation/delay.d.ts +0 -0
  85. package/lib/types/{lib/reanimated2 → reanimated2}/animation/index.d.ts +0 -0
  86. package/lib/types/{lib/reanimated2 → reanimated2}/animation/repeat.d.ts +0 -0
  87. package/lib/types/{lib/reanimated2 → reanimated2}/animation/sequence.d.ts +0 -0
  88. package/lib/types/{lib/reanimated2 → reanimated2}/animation/spring.d.ts +0 -0
  89. package/lib/types/{lib/reanimated2 → reanimated2}/animation/styleAnimation.d.ts +0 -0
  90. package/lib/types/{lib/reanimated2 → reanimated2}/animation/timing.d.ts +0 -0
  91. package/lib/types/{lib/reanimated2 → reanimated2}/animation/util.d.ts +0 -0
  92. package/lib/types/{lib/reanimated2 → reanimated2}/commonTypes.d.ts +2 -1
  93. package/lib/types/{lib/reanimated2 → reanimated2}/component/FlatList.d.ts +0 -0
  94. package/lib/types/{lib/reanimated2 → reanimated2}/component/WrappedComponents.d.ts +0 -0
  95. package/lib/types/{lib/reanimated2 → reanimated2}/component/index.d.ts +0 -0
  96. package/lib/types/{lib/reanimated2 → reanimated2}/core.d.ts +0 -0
  97. package/lib/types/reanimated2/fabricUtils.d.ts +4 -0
  98. package/lib/types/{lib/reanimated2 → reanimated2}/hook/Hooks.d.ts +0 -0
  99. package/lib/types/{lib/reanimated2 → reanimated2}/hook/commonTypes.d.ts +2 -1
  100. package/lib/types/{lib/reanimated2 → reanimated2}/hook/index.d.ts +1 -1
  101. package/lib/types/{lib/reanimated2 → reanimated2}/hook/useAnimatedGestureHandler.d.ts +2 -2
  102. package/lib/types/{lib/reanimated2 → reanimated2}/hook/useAnimatedReaction.d.ts +0 -0
  103. package/lib/types/{lib/reanimated2 → reanimated2}/hook/useAnimatedRef.d.ts +0 -0
  104. package/lib/types/{lib/reanimated2 → reanimated2}/hook/useAnimatedScrollHandler.d.ts +2 -2
  105. package/lib/types/{lib/reanimated2 → reanimated2}/hook/useAnimatedSensor.d.ts +0 -0
  106. package/lib/types/{lib/reanimated2 → reanimated2}/hook/useAnimatedStyle.d.ts +0 -0
  107. package/lib/types/{lib/reanimated2 → reanimated2}/hook/useDerivedValue.d.ts +0 -0
  108. package/lib/types/{lib/reanimated2 → reanimated2}/hook/useSharedValue.d.ts +0 -0
  109. package/lib/types/{lib/reanimated2 → reanimated2}/hook/utils.d.ts +2 -2
  110. package/lib/types/{lib/reanimated2 → reanimated2}/index.d.ts +0 -0
  111. package/lib/types/{lib/reanimated2 → reanimated2}/interpolateColor.d.ts +5 -0
  112. package/lib/types/{lib/reanimated2 → reanimated2}/interpolation.d.ts +1 -4
  113. package/lib/types/{lib/reanimated2 → reanimated2}/jestUtils.d.ts +0 -0
  114. package/lib/types/{lib/reanimated2 → reanimated2}/js-reanimated/JSReanimated.d.ts +0 -0
  115. package/lib/types/{lib/reanimated2 → reanimated2}/js-reanimated/Mapper.d.ts +0 -0
  116. package/lib/types/{lib/reanimated2 → reanimated2}/js-reanimated/MapperRegistry.d.ts +0 -0
  117. package/lib/types/{lib/reanimated2 → reanimated2}/js-reanimated/MutableValue.d.ts +0 -0
  118. package/lib/types/{lib/reanimated2 → reanimated2}/js-reanimated/commonTypes.d.ts +0 -0
  119. package/lib/types/{lib/reanimated2 → reanimated2}/js-reanimated/index.d.ts +0 -0
  120. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/LayoutAnimationRepository.d.ts +0 -0
  121. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/animationBuilder/BaseAnimationBuilder.d.ts +0 -0
  122. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/animationBuilder/ComplexAnimationBuilder.d.ts +0 -0
  123. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/animationBuilder/Keyframe.d.ts +0 -0
  124. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/animationBuilder/commonTypes.d.ts +0 -0
  125. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/animationBuilder/index.d.ts +0 -0
  126. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Bounce.d.ts +0 -0
  127. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Default.d.ts +0 -0
  128. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Fade.d.ts +0 -0
  129. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Flip.d.ts +0 -0
  130. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Lightspeed.d.ts +0 -0
  131. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Pinwheel.d.ts +0 -0
  132. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Roll.d.ts +0 -0
  133. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Rotate.d.ts +0 -0
  134. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Slide.d.ts +0 -0
  135. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Stretch.d.ts +0 -0
  136. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Zoom.d.ts +0 -0
  137. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/index.d.ts +0 -0
  138. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultTransitions/CurvedTransition.d.ts +0 -0
  139. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultTransitions/EntryExitTransition.d.ts +0 -0
  140. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultTransitions/FadingTransition.d.ts +0 -0
  141. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultTransitions/JumpingTransition.d.ts +0 -0
  142. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultTransitions/LinearTransition.d.ts +0 -0
  143. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultTransitions/SequencedTransition.d.ts +0 -0
  144. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultTransitions/index.d.ts +0 -0
  145. package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/index.d.ts +0 -0
  146. package/lib/types/{lib/reanimated2 → reanimated2}/mock.d.ts +0 -0
  147. package/lib/types/{lib/reanimated2 → reanimated2}/platform-specific/RNRenderer.d.ts +0 -0
  148. package/lib/types/{lib/reanimated2 → reanimated2}/platform-specific/RNRenderer.web.d.ts +0 -0
  149. package/lib/types/{lib/reanimated2 → reanimated2}/utils.d.ts +0 -0
  150. package/lib/types/{lib/setAndForwardRef.d.ts → setAndForwardRef.d.ts} +0 -0
  151. package/package.json +7 -5
  152. package/plugin.js +4 -1
  153. package/src/Animated.js +0 -4
  154. package/src/createAnimatedComponent.tsx +37 -197
  155. package/src/reanimated2/Easing.ts +0 -53
  156. package/src/reanimated2/NativeMethods.ts +39 -7
  157. package/src/reanimated2/UpdateProps.ts +38 -19
  158. package/src/reanimated2/commonTypes.ts +4 -1
  159. package/src/reanimated2/component/FlatList.tsx +8 -5
  160. package/src/reanimated2/core.ts +7 -1
  161. package/src/reanimated2/fabricUtils.ts +27 -0
  162. package/src/reanimated2/globals.d.ts +17 -1
  163. package/src/reanimated2/hook/commonTypes.ts +4 -2
  164. package/src/reanimated2/hook/index.ts +1 -1
  165. package/src/reanimated2/hook/useAnimatedGestureHandler.ts +2 -2
  166. package/src/reanimated2/hook/useAnimatedRef.ts +8 -3
  167. package/src/reanimated2/hook/useAnimatedScrollHandler.ts +2 -2
  168. package/src/reanimated2/hook/utils.ts +2 -11
  169. package/src/reanimated2/interpolateColor.ts +6 -2
  170. package/src/reanimated2/interpolation.ts +1 -26
  171. package/src/reanimated2/js-reanimated/index.ts +5 -0
  172. package/android/.gradle/7.2/dependencies-accessors/dependencies-accessors.lock +0 -0
  173. package/android/.gradle/7.2/dependencies-accessors/gc.properties +0 -0
  174. package/android/.gradle/7.2/executionHistory/executionHistory.bin +0 -0
  175. package/android/.gradle/7.2/executionHistory/executionHistory.lock +0 -0
  176. package/android/.gradle/7.2/fileChanges/last-build.bin +0 -0
  177. package/android/.gradle/7.2/fileHashes/fileHashes.bin +0 -0
  178. package/android/.gradle/7.2/fileHashes/fileHashes.lock +0 -0
  179. package/android/.gradle/7.2/fileHashes/resourceHashesCache.bin +0 -0
  180. package/android/.gradle/7.2/gc.properties +0 -0
  181. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  182. package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
  183. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  184. package/android/.gradle/checksums/checksums.lock +0 -0
  185. package/android/.gradle/checksums/md5-checksums.bin +0 -0
  186. package/android/.gradle/checksums/sha1-checksums.bin +0 -0
  187. package/android/.gradle/vcs-1/gc.properties +0 -0
  188. package/android/react-native-reanimated-64-hermes.aar +0 -0
  189. package/android/react-native-reanimated-64-jsc.aar +0 -0
  190. package/android/react-native-reanimated-65-hermes.aar +0 -0
  191. package/android/react-native-reanimated-65-jsc.aar +0 -0
  192. package/android/react-native-reanimated-66-hermes.aar +0 -0
  193. package/android/react-native-reanimated-66-jsc.aar +0 -0
  194. package/android/react-native-reanimated-67-hermes.aar +0 -0
  195. package/android/react-native-reanimated-67-jsc.aar +0 -0
  196. package/android/react-native-reanimated-68-hermes.aar +0 -0
  197. package/android/react-native-reanimated-68-jsc.aar +0 -0
  198. package/android/src/main/java/com/swmansion/reanimated/UpdateContext.java +0 -11
  199. package/android/src/main/java/com/swmansion/reanimated/nodes/AlwaysNode.java +0 -29
  200. package/android/src/main/java/com/swmansion/reanimated/nodes/BezierNode.java +0 -87
  201. package/android/src/main/java/com/swmansion/reanimated/nodes/BlockNode.java +0 -24
  202. package/android/src/main/java/com/swmansion/reanimated/nodes/CallFuncNode.java +0 -49
  203. package/android/src/main/java/com/swmansion/reanimated/nodes/ClockNode.java +0 -38
  204. package/android/src/main/java/com/swmansion/reanimated/nodes/ClockOpNode.java +0 -73
  205. package/android/src/main/java/com/swmansion/reanimated/nodes/ConcatNode.java +0 -36
  206. package/android/src/main/java/com/swmansion/reanimated/nodes/CondNode.java +0 -41
  207. package/android/src/main/java/com/swmansion/reanimated/nodes/DebugNode.java +0 -33
  208. package/android/src/main/java/com/swmansion/reanimated/nodes/EventNode.java +0 -83
  209. package/android/src/main/java/com/swmansion/reanimated/nodes/FinalNode.java +0 -5
  210. package/android/src/main/java/com/swmansion/reanimated/nodes/FunctionNode.java +0 -20
  211. package/android/src/main/java/com/swmansion/reanimated/nodes/JSCallNode.java +0 -41
  212. package/android/src/main/java/com/swmansion/reanimated/nodes/Node.java +0 -139
  213. package/android/src/main/java/com/swmansion/reanimated/nodes/NoopNode.java +0 -37
  214. package/android/src/main/java/com/swmansion/reanimated/nodes/OperatorNode.java +0 -377
  215. package/android/src/main/java/com/swmansion/reanimated/nodes/ParamNode.java +0 -71
  216. package/android/src/main/java/com/swmansion/reanimated/nodes/PropsNode.java +0 -153
  217. package/android/src/main/java/com/swmansion/reanimated/nodes/SetNode.java +0 -32
  218. package/android/src/main/java/com/swmansion/reanimated/nodes/StyleNode.java +0 -40
  219. package/android/src/main/java/com/swmansion/reanimated/nodes/TransformNode.java +0 -84
  220. package/android/src/main/java/com/swmansion/reanimated/nodes/ValueNode.java +0 -40
  221. package/android/src/main/java/com/swmansion/reanimated/transitions/ChangeTransition.java +0 -84
  222. package/android/src/main/java/com/swmansion/reanimated/transitions/SaneSidePropagation.java +0 -25
  223. package/android/src/main/java/com/swmansion/reanimated/transitions/Scale.java +0 -86
  224. package/android/src/main/java/com/swmansion/reanimated/transitions/TransitionModule.java +0 -41
  225. package/android/src/main/java/com/swmansion/reanimated/transitions/TransitionUtils.java +0 -161
  226. package/ios/Nodes/REAAlwaysNode.h +0 -4
  227. package/ios/Nodes/REAAlwaysNode.m +0 -35
  228. package/ios/Nodes/REABezierNode.h +0 -5
  229. package/ios/Nodes/REABezierNode.m +0 -103
  230. package/ios/Nodes/REABlockNode.h +0 -5
  231. package/ios/Nodes/REABlockNode.m +0 -25
  232. package/ios/Nodes/REACallFuncNode.h +0 -6
  233. package/ios/Nodes/REACallFuncNode.m +0 -69
  234. package/ios/Nodes/REAClockNodes.h +0 -19
  235. package/ios/Nodes/REAClockNodes.m +0 -118
  236. package/ios/Nodes/REAConcatNode.h +0 -5
  237. package/ios/Nodes/REAConcatNode.m +0 -32
  238. package/ios/Nodes/REACondNode.h +0 -5
  239. package/ios/Nodes/REACondNode.m +0 -36
  240. package/ios/Nodes/READebugNode.h +0 -5
  241. package/ios/Nodes/READebugNode.m +0 -30
  242. package/ios/Nodes/REAEventNode.h +0 -8
  243. package/ios/Nodes/REAEventNode.m +0 -35
  244. package/ios/Nodes/REAFunctionNode.h +0 -6
  245. package/ios/Nodes/REAFunctionNode.m +0 -24
  246. package/ios/Nodes/REAJSCallNode.h +0 -5
  247. package/ios/Nodes/REAJSCallNode.m +0 -30
  248. package/ios/Nodes/REANode.h +0 -40
  249. package/ios/Nodes/REANode.m +0 -155
  250. package/ios/Nodes/REAOperatorNode.h +0 -5
  251. package/ios/Nodes/REAOperatorNode.m +0 -114
  252. package/ios/Nodes/REAParamNode.h +0 -10
  253. package/ios/Nodes/REAParamNode.m +0 -79
  254. package/ios/Nodes/REAPropsNode.h +0 -9
  255. package/ios/Nodes/REAPropsNode.m +0 -96
  256. package/ios/Nodes/REASetNode.h +0 -5
  257. package/ios/Nodes/REASetNode.m +0 -34
  258. package/ios/Nodes/REAStyleNode.h +0 -5
  259. package/ios/Nodes/REAStyleNode.m +0 -27
  260. package/ios/Nodes/REATransformNode.h +0 -5
  261. package/ios/Nodes/REATransformNode.m +0 -36
  262. package/ios/Nodes/REAValueNode.h +0 -9
  263. package/ios/Nodes/REAValueNode.m +0 -26
  264. package/ios/REAModule.m +0 -184
  265. package/ios/Transitioning/RCTConvert+REATransition.h +0 -11
  266. package/ios/Transitioning/RCTConvert+REATransition.m +0 -53
  267. package/ios/Transitioning/REAAllTransitions.h +0 -26
  268. package/ios/Transitioning/REAAllTransitions.m +0 -296
  269. package/ios/Transitioning/REATransition.h +0 -64
  270. package/ios/Transitioning/REATransition.m +0 -210
  271. package/ios/Transitioning/REATransitionAnimation.h +0 -17
  272. package/ios/Transitioning/REATransitionAnimation.m +0 -79
  273. package/ios/Transitioning/REATransitionManager.h +0 -9
  274. package/ios/Transitioning/REATransitionManager.m +0 -60
  275. package/ios/Transitioning/REATransitionValues.h +0 -15
  276. package/ios/Transitioning/REATransitionValues.m +0 -25
  277. package/lib/reanimated1/Easing.js +0 -231
  278. package/lib/reanimated1/SpringConfig.js +0 -79
  279. package/lib/reanimated1/Transitioning.js +0 -158
  280. package/lib/reanimated1/animations/Animation.js +0 -32
  281. package/lib/reanimated1/animations/SpringUtils.js +0 -199
  282. package/lib/reanimated1/animations/backwardCompatibleAnimWrapper.js +0 -117
  283. package/lib/reanimated1/animations/decay.js +0 -54
  284. package/lib/reanimated1/animations/spring.js +0 -198
  285. package/lib/reanimated1/animations/timing.js +0 -74
  286. package/lib/reanimated1/base.js +0 -13
  287. package/lib/reanimated1/core/AnimatedAlways.js +0 -33
  288. package/lib/reanimated1/core/AnimatedBezier.js +0 -150
  289. package/lib/reanimated1/core/AnimatedBlock.js +0 -52
  290. package/lib/reanimated1/core/AnimatedCall.js +0 -55
  291. package/lib/reanimated1/core/AnimatedCallFunc.js +0 -72
  292. package/lib/reanimated1/core/AnimatedClock.js +0 -90
  293. package/lib/reanimated1/core/AnimatedClockTest.js +0 -22
  294. package/lib/reanimated1/core/AnimatedCode.js +0 -32
  295. package/lib/reanimated1/core/AnimatedConcat.js +0 -32
  296. package/lib/reanimated1/core/AnimatedCond.js +0 -57
  297. package/lib/reanimated1/core/AnimatedDebug.js +0 -62
  298. package/lib/reanimated1/core/AnimatedEvent.js +0 -126
  299. package/lib/reanimated1/core/AnimatedFunction.js +0 -55
  300. package/lib/reanimated1/core/AnimatedNode.js +0 -223
  301. package/lib/reanimated1/core/AnimatedOperator.js +0 -103
  302. package/lib/reanimated1/core/AnimatedParam.js +0 -88
  303. package/lib/reanimated1/core/AnimatedProps.js +0 -108
  304. package/lib/reanimated1/core/AnimatedSet.js +0 -38
  305. package/lib/reanimated1/core/AnimatedStartClock.js +0 -30
  306. package/lib/reanimated1/core/AnimatedStopClock.js +0 -30
  307. package/lib/reanimated1/core/AnimatedStyle.js +0 -78
  308. package/lib/reanimated1/core/AnimatedTransform.js +0 -78
  309. package/lib/reanimated1/core/AnimatedValue.js +0 -38
  310. package/lib/reanimated1/core/Core.test.js +0 -30
  311. package/lib/reanimated1/core/InternalAnimatedValue.js +0 -87
  312. package/lib/reanimated1/core/__mocks__/AnimatedProps.js +0 -86
  313. package/lib/reanimated1/core/createEventObjectProxyPolyfill.js +0 -44
  314. package/lib/reanimated1/derived/__mocks__/evaluateOnce.js +0 -14
  315. package/lib/reanimated1/derived/acc.js +0 -11
  316. package/lib/reanimated1/derived/color.js +0 -47
  317. package/lib/reanimated1/derived/diff.js +0 -16
  318. package/lib/reanimated1/derived/diffClamp.js +0 -11
  319. package/lib/reanimated1/derived/evaluateOnce.js +0 -35
  320. package/lib/reanimated1/derived/index.js +0 -8
  321. package/lib/reanimated1/derived/interpolate.js +0 -152
  322. package/lib/reanimated1/derived/interpolateColors.js +0 -62
  323. package/lib/reanimated1/derived/onChange.js +0 -14
  324. package/lib/reanimated1/derived/useCode.js +0 -41
  325. package/lib/reanimated1/index.js +0 -53
  326. package/lib/reanimated1/operators.js +0 -35
  327. package/lib/reanimated1/useValue.js +0 -10
  328. package/lib/reanimated1/val.js +0 -3
  329. package/lib/types/react-native-reanimated-tests.d.ts +0 -1
  330. package/src/reanimated1/Easing.js +0 -231
  331. package/src/reanimated1/SpringConfig.js +0 -79
  332. package/src/reanimated1/Transitioning.js +0 -158
  333. package/src/reanimated1/animations/Animation.js +0 -32
  334. package/src/reanimated1/animations/SpringUtils.js +0 -199
  335. package/src/reanimated1/animations/backwardCompatibleAnimWrapper.js +0 -117
  336. package/src/reanimated1/animations/decay.js +0 -54
  337. package/src/reanimated1/animations/spring.js +0 -198
  338. package/src/reanimated1/animations/timing.js +0 -74
  339. package/src/reanimated1/base.js +0 -13
  340. package/src/reanimated1/core/AnimatedAlways.js +0 -33
  341. package/src/reanimated1/core/AnimatedBezier.js +0 -150
  342. package/src/reanimated1/core/AnimatedBlock.js +0 -52
  343. package/src/reanimated1/core/AnimatedCall.js +0 -55
  344. package/src/reanimated1/core/AnimatedCallFunc.js +0 -72
  345. package/src/reanimated1/core/AnimatedClock.js +0 -90
  346. package/src/reanimated1/core/AnimatedClockTest.js +0 -22
  347. package/src/reanimated1/core/AnimatedCode.js +0 -32
  348. package/src/reanimated1/core/AnimatedConcat.js +0 -32
  349. package/src/reanimated1/core/AnimatedCond.js +0 -57
  350. package/src/reanimated1/core/AnimatedDebug.js +0 -62
  351. package/src/reanimated1/core/AnimatedEvent.js +0 -126
  352. package/src/reanimated1/core/AnimatedFunction.js +0 -55
  353. package/src/reanimated1/core/AnimatedNode.js +0 -223
  354. package/src/reanimated1/core/AnimatedOperator.js +0 -103
  355. package/src/reanimated1/core/AnimatedParam.js +0 -88
  356. package/src/reanimated1/core/AnimatedProps.js +0 -108
  357. package/src/reanimated1/core/AnimatedSet.js +0 -38
  358. package/src/reanimated1/core/AnimatedStartClock.js +0 -30
  359. package/src/reanimated1/core/AnimatedStopClock.js +0 -30
  360. package/src/reanimated1/core/AnimatedStyle.js +0 -78
  361. package/src/reanimated1/core/AnimatedTransform.js +0 -78
  362. package/src/reanimated1/core/AnimatedValue.js +0 -38
  363. package/src/reanimated1/core/Core.test.js +0 -30
  364. package/src/reanimated1/core/InternalAnimatedValue.js +0 -87
  365. package/src/reanimated1/core/__mocks__/AnimatedProps.js +0 -86
  366. package/src/reanimated1/core/createEventObjectProxyPolyfill.js +0 -44
  367. package/src/reanimated1/derived/__mocks__/evaluateOnce.js +0 -14
  368. package/src/reanimated1/derived/acc.js +0 -11
  369. package/src/reanimated1/derived/color.js +0 -47
  370. package/src/reanimated1/derived/diff.js +0 -16
  371. package/src/reanimated1/derived/diffClamp.js +0 -11
  372. package/src/reanimated1/derived/evaluateOnce.js +0 -35
  373. package/src/reanimated1/derived/index.js +0 -8
  374. package/src/reanimated1/derived/interpolate.js +0 -152
  375. package/src/reanimated1/derived/interpolateColors.js +0 -62
  376. package/src/reanimated1/derived/onChange.js +0 -14
  377. package/src/reanimated1/derived/useCode.js +0 -41
  378. package/src/reanimated1/index.js +0 -53
  379. package/src/reanimated1/operators.js +0 -35
  380. package/src/reanimated1/useValue.js +0 -10
  381. package/src/reanimated1/val.js +0 -3
@@ -1,6 +1,9 @@
1
1
  #pragma once
2
2
 
3
3
  #include <jsi/jsi.h>
4
+ #ifdef RCT_NEW_ARCH_ENABLED
5
+ #include <react/renderer/core/ShadowNode.h>
6
+ #endif
4
7
  #include <memory>
5
8
  #include <string>
6
9
  #include <vector>
@@ -9,6 +12,8 @@
9
12
  #include "SharedParent.h"
10
13
  #include "WorkletsCache.h"
11
14
 
15
+ using namespace facebook::react;
16
+
12
17
  namespace reanimated {
13
18
 
14
19
  class HostFunctionWrapper;
@@ -42,6 +47,10 @@ class ValueWrapper {
42
47
  const std::unique_ptr<ValueWrapper> &valueContainer);
43
48
  static inline const std::shared_ptr<MutableValue> &asMutableValue(
44
49
  const std::unique_ptr<ValueWrapper> &valueContainer);
50
+ #ifdef RCT_NEW_ARCH_ENABLED
51
+ static inline const ShadowNode::Shared &asShadowNode(
52
+ const std::unique_ptr<ValueWrapper> &valueContainer);
53
+ #endif
45
54
 
46
55
  static const HostFunctionWrapper *asHostFunctionWrapper(
47
56
  const std::unique_ptr<ValueWrapper> &valueContainer);
@@ -109,6 +118,15 @@ class MutableValueWrapper : public ValueWrapper {
109
118
  std::shared_ptr<MutableValue> value;
110
119
  };
111
120
 
121
+ #ifdef RCT_NEW_ARCH_ENABLED
122
+ class ShadowNodeValueWrapper : public ValueWrapper {
123
+ public:
124
+ explicit ShadowNodeValueWrapper(const ShadowNode::Shared &_value)
125
+ : ValueWrapper(ValueType::ShadowNodeType), value(_value) {}
126
+ ShadowNode::Shared value;
127
+ };
128
+ #endif
129
+
112
130
  inline bool ValueWrapper::asBoolean(
113
131
  const std::unique_ptr<ValueWrapper> &valueContainer) {
114
132
  return static_cast<BooleanValueWrapper *>(valueContainer.get())->value;
@@ -150,6 +168,13 @@ inline const std::shared_ptr<MutableValue> &ValueWrapper::asMutableValue(
150
168
  return static_cast<MutableValueWrapper *>(valueContainer.get())->value;
151
169
  }
152
170
 
171
+ #ifdef RCT_NEW_ARCH_ENABLED
172
+ inline const ShadowNode::Shared &ValueWrapper::asShadowNode(
173
+ const std::unique_ptr<ValueWrapper> &valueContainer) {
174
+ return static_cast<ShadowNodeValueWrapper *>(valueContainer.get())->value;
175
+ }
176
+ #endif
177
+
153
178
  inline const HostFunctionWrapper *ValueWrapper::asHostFunctionWrapper(
154
179
  const std::unique_ptr<ValueWrapper> &valueContainer) {
155
180
  return static_cast<HostFunctionWrapper *>(valueContainer.get());
@@ -2,7 +2,12 @@
2
2
 
3
3
  #include <memory>
4
4
  #include <string>
5
+
6
+ #ifdef __APPLE__
7
+ #include "RNReanimated/Scheduler.h"
8
+ #else
5
9
  #include "Scheduler.h"
10
+ #endif
6
11
 
7
12
  namespace reanimated {
8
13
 
@@ -29,7 +29,7 @@ class Mapper : public std::enable_shared_from_this<Mapper> {
29
29
  std::vector<std::shared_ptr<MutableValue>> outputs;
30
30
  bool dirty = true;
31
31
  std::shared_ptr<jsi::Function> userUpdater;
32
- UpdaterFunction *updateProps;
32
+ UpdatePropsFunction updateProps;
33
33
  int optimalizationLvl = 0;
34
34
  std::shared_ptr<ShareableValue> viewDescriptors;
35
35
 
@@ -1,25 +1,56 @@
1
1
  #pragma once
2
2
 
3
3
  #include <jsi/jsi.h>
4
- #include <stdio.h>
4
+
5
+ #ifdef RCT_NEW_ARCH_ENABLED
6
+ #include <react/renderer/core/ReactPrimitives.h>
7
+ #endif
8
+
5
9
  #include <string>
6
10
  #include <utility>
7
11
  #include <vector>
8
12
 
9
13
  using namespace facebook;
10
14
 
15
+ #ifdef RCT_NEW_ARCH_ENABLED
16
+ using namespace react;
17
+ #endif
18
+
11
19
  namespace reanimated {
12
20
 
13
- using UpdaterFunction = std::function<void(
21
+ #ifdef RCT_NEW_ARCH_ENABLED
22
+
23
+ using SynchronouslyUpdateUIPropsFunction =
24
+ std::function<void(jsi::Runtime &rt, Tag tag, const jsi::Value &props)>;
25
+ using UpdatePropsFunction = std::function<void(
26
+ jsi::Runtime &rt,
27
+ const jsi::Value &shadowNodeValue,
28
+ const jsi::Value &props)>;
29
+ using RemoveShadowNodeFromRegistryFunction =
30
+ std::function<void(jsi::Runtime &rt, const jsi::Value &shadowNodeValue)>;
31
+ using DispatchCommandFunction = std::function<void(
32
+ jsi::Runtime &rt,
33
+ const jsi::Value &shadowNodeValue,
34
+ const jsi::Value &commandNameValue,
35
+ const jsi::Value &argsValue)>;
36
+ using MeasureFunction = std::function<
37
+ jsi::Value(jsi::Runtime &rt, const jsi::Value &shadowNodeValue)>;
38
+
39
+ #else
40
+
41
+ using UpdatePropsFunction = std::function<void(
14
42
  jsi::Runtime &rt,
15
43
  int viewTag,
16
44
  const jsi::Value &viewName,
17
45
  const jsi::Object &object)>;
18
- using RequestRender =
19
- std::function<void(std::function<void(double)>, jsi::Runtime &rt)>;
20
46
  using ScrollToFunction = std::function<void(int, double, double, bool)>;
21
- using MeasuringFunction =
47
+ using MeasureFunction =
22
48
  std::function<std::vector<std::pair<std::string, double>>(int)>;
49
+
50
+ #endif // RCT_NEW_ARCH_ENABLED
51
+
52
+ using RequestRender =
53
+ std::function<void(std::function<void(double)>, jsi::Runtime &rt)>;
23
54
  using TimeProviderFunction = std::function<double(void)>;
24
55
 
25
56
  using RegisterSensorFunction =
@@ -33,14 +64,18 @@ using ConfigurePropsFunction = std::function<void(
33
64
 
34
65
  struct PlatformDepMethodsHolder {
35
66
  RequestRender requestRender;
36
- UpdaterFunction updaterFunction;
67
+ #ifdef RCT_NEW_ARCH_ENABLED
68
+ SynchronouslyUpdateUIPropsFunction synchronouslyUpdateUIPropsFunction;
69
+ #else
70
+ UpdatePropsFunction updatePropsFunction;
37
71
  ScrollToFunction scrollToFunction;
38
- MeasuringFunction measuringFunction;
72
+ MeasureFunction measureFunction;
73
+ ConfigurePropsFunction configurePropsFunction;
74
+ #endif
39
75
  TimeProviderFunction getCurrentTime;
40
76
  RegisterSensorFunction registerSensor;
41
77
  UnregisterSensorFunction unregisterSensor;
42
78
  SetGestureStateFunction setGestureStateFunction;
43
- ConfigurePropsFunction configurePropsFunction;
44
79
  };
45
80
 
46
81
  } // namespace reanimated
@@ -31,10 +31,15 @@ class RuntimeDecorator {
31
31
  static void decorateRuntime(jsi::Runtime &rt, const std::string &label);
32
32
  static void decorateUIRuntime(
33
33
  jsi::Runtime &rt,
34
- const UpdaterFunction updater,
35
- const RequestFrameFunction requestFrame,
34
+ const UpdatePropsFunction updateProps,
35
+ const MeasureFunction measure,
36
+ #ifdef RCT_NEW_ARCH_ENABLED
37
+ const RemoveShadowNodeFromRegistryFunction removeShadowNodeFromRegistry,
38
+ const DispatchCommandFunction dispatchCommand,
39
+ #else
36
40
  const ScrollToFunction scrollTo,
37
- const MeasuringFunction measure,
41
+ #endif
42
+ const RequestFrameFunction requestFrame,
38
43
  const TimeProviderFunction getCurrentTime,
39
44
  const RegisterSensorFunction registerSensor,
40
45
  const UnregisterSensorFunction unregisterSensor,
package/README.md CHANGED
@@ -13,6 +13,10 @@ comes to gesture based interactions.
13
13
 
14
14
  Check out the [installation](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation) section of our docs for the detailed installation instructions.
15
15
 
16
+ ## Fabric
17
+
18
+ To learn how to use `react-native-reanimated` with Fabric architecture, head over to [Fabric README](README-Fabric.md). Instructions on how to run Fabric Example within this repo can be found in the [FabricExample README](FabricExample/README.md).
19
+
16
20
  ## Documentation
17
21
 
18
22
  Check out our dedicated documentation page for info about this library, API reference and more: [https://docs.swmansion.com/react-native-reanimated/docs/](https://docs.swmansion.com/react-native-reanimated/docs/)
@@ -38,16 +38,21 @@ end
38
38
 
39
39
  rnVersion = reactVersion.split('.')[1]
40
40
 
41
+ fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
42
+
41
43
  folly_prefix = ""
42
44
  if rnVersion.to_i >= 64
43
45
  folly_prefix = "RCT-"
44
46
  end
45
47
 
46
-
47
- folly_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DRNVERSION=' + rnVersion
48
+ folly_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -DRNVERSION=' + rnVersion
48
49
  folly_compiler_flags = folly_flags + ' ' + '-Wno-comma -Wno-shorten-64-to-32'
49
- folly_version = '2021.04.26.00'
50
+ folly_version = '2021.06.28.00-v2'
50
51
  boost_compiler_flags = '-Wno-documentation'
52
+ fabric_flags = ''
53
+ if fabric_enabled
54
+ fabric_flags = '-DRN_FABRIC_ENABLED -DRCT_NEW_ARCH_ENABLED'
55
+ end
51
56
 
52
57
  Pod::Spec.new do |s|
53
58
  s.name = "RNReanimated"
@@ -75,21 +80,29 @@ Pod::Spec.new do |s|
75
80
 
76
81
  s.pod_target_xcconfig = {
77
82
  "USE_HEADERMAP" => "YES",
78
- "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_TARGET_SRCROOT)\" \"$(PODS_ROOT)/#{folly_prefix}Folly\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/Headers/Private/React-Core\" "
83
+ "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_TARGET_SRCROOT)\" \"$(PODS_ROOT)/#{folly_prefix}Folly\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/Headers/Private/React-Core\"",
84
+ "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
79
85
  }
80
86
  s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
81
87
  s.xcconfig = {
82
- "CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
83
- "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/glog\" \"$(PODS_ROOT)/#{folly_prefix}Folly\" \"${PODS_ROOT}/Headers/Public/React-hermes\" \"${PODS_ROOT}/Headers/Public/hermes-engine\"",
84
- "OTHER_CFLAGS" => "$(inherited)" + " " + folly_flags }
88
+ "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/glog\" \"$(PODS_ROOT)/#{folly_prefix}Folly\" \"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-hermes\" \"${PODS_ROOT}/Headers/Public/hermes-engine\"",
89
+ "OTHER_CFLAGS" => "$(inherited)" + " " + folly_flags + " " + fabric_flags }
85
90
 
86
91
  s.requires_arc = true
87
92
 
88
93
  s.dependency "React-Core"
94
+ if fabric_enabled
95
+ s.dependency "React-RCTFabric"
96
+ s.dependency "React-Codegen"
97
+ s.dependency "RCT-Folly", folly_version
98
+ else
99
+ s.dependency "#{folly_prefix}Folly"
100
+ end
101
+ s.dependency "RCTRequired"
102
+ s.dependency "RCTTypeSafety"
103
+ s.dependency "ReactCommon/turbomodule/core"
89
104
  s.dependency 'FBLazyVector'
90
105
  s.dependency 'FBReactNativeSpec'
91
- s.dependency 'RCTRequired'
92
- s.dependency 'RCTTypeSafety'
93
106
  s.dependency 'React-Core'
94
107
  s.dependency 'React-CoreModules'
95
108
  s.dependency 'React-Core/DevSupport'
@@ -108,7 +121,6 @@ Pod::Spec.new do |s|
108
121
  s.dependency 'React-jsi'
109
122
  s.dependency 'React-jsiexecutor'
110
123
  s.dependency 'React-jsinspector'
111
- s.dependency 'ReactCommon/turbomodule/core'
112
124
  s.dependency 'Yoga'
113
125
  s.dependency 'DoubleConversion'
114
126
  s.dependency 'glog'
@@ -119,7 +131,6 @@ Pod::Spec.new do |s|
119
131
  s.dependency 'React-callinvoker'
120
132
  end
121
133
 
122
- s.dependency "#{folly_prefix}Folly"
123
134
 
124
135
  end
125
136
 
@@ -1,8 +1,14 @@
1
1
  cmake_minimum_required(VERSION 3.5.1)
2
2
 
3
3
  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")
4
+ set (CMAKE_CXX_STANDARD 17)
5
+ 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 -DFOR_HERMES=${FOR_HERMES} -fexceptions -fno-omit-frame-pointer -frtti -Wno-sign-compare -std=c++17 -Wall")
6
+ if(${IS_NEW_ARCHITECTURE_ENABLED})
7
+ set (ALL_FLAGS "${DEFAULT_FLAGS} -DRCT_NEW_ARCH_ENABLED")
8
+ else()
9
+ set (ALL_FLAGS ${DEFAULT_FLAGS})
10
+ endif()
11
+ set (CMAKE_CXX_FLAGS ${ALL_FLAGS})
6
12
 
7
13
  if(${NATIVE_DEBUG})
8
14
  set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g")
@@ -13,20 +19,32 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
13
19
  set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE INTERNAL "")
14
20
 
15
21
  set (PACKAGE_NAME "reanimated")
22
+ set (BUILD_DIR ${CMAKE_SOURCE_DIR}/build)
16
23
  set (SRC_DIR ${CMAKE_SOURCE_DIR}/src)
17
24
 
18
25
  if(${CLIENT_SIDE_BUILD})
19
26
  set (NODE_MODULES_DIR "${CMAKE_SOURCE_DIR}/../../")
20
27
  set (COMMON_SRC_DIR "${CMAKE_SOURCE_DIR}/../Common")
21
28
  else()
22
- set (NODE_MODULES_DIR "../node_modules")
29
+ set (NODE_MODULES_DIR "../${PLAYGROUND_APP_NAME}/node_modules")
23
30
  set (COMMON_SRC_DIR "${SRC_DIR}/main/Common")
24
31
  endif()
25
32
 
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)
33
+ if(${IS_NEW_ARCHITECTURE_ENABLED})
34
+ if(${CLIENT_SIDE_BUILD})
35
+ set (RN_SO_DIR "${CMAKE_SOURCE_DIR}/../../../android/app/build/react-ndk/exported")
36
+ set (FBJNI_HEADERS_DIR "${CMAKE_SOURCE_DIR}/../../react-native/ReactAndroid/src/main/jni/first-party/fbjni/headers")
37
+ else()
38
+ set (RN_SO_DIR "${CMAKE_SOURCE_DIR}/../${PLAYGROUND_APP_NAME}/android/app/build/react-ndk/exported")
39
+ set (FBJNI_HEADERS_DIR "${CMAKE_SOURCE_DIR}/../${PLAYGROUND_APP_NAME}/node_modules/react-native/ReactAndroid/src/main/jni/first-party/fbjni/headers")
40
+ endif()
41
+ else()
42
+ set (RN_SO_DIR ${NODE_MODULES_DIR}/react-native/ReactAndroid/src/main/jni/first-party/react/jni)
43
+ set (FBJNI_HEADERS_DIR "${NODE_MODULES_DIR}/react-native/ReactAndroid/src/main/jni/first-party/fbjni/headers")
44
+ endif()
28
45
 
29
- # reanimated shared
46
+ file (GLOB LIBRN_DIR "${RN_SO_DIR}/${ANDROID_ABI}")
47
+ file (GLOB HERMES_DIR "${BUILD_DIR}/third-party-ndk/hermes/jni/${ANDROID_ABI}")
30
48
 
31
49
  file(GLOB sources_tools "${COMMON_SRC_DIR}/cpp/Tools/*.cpp")
32
50
  file(GLOB sources_native_modules "${COMMON_SRC_DIR}/cpp/NativeModules/*.cpp")
@@ -45,6 +63,17 @@ if(${REACT_NATIVE_TARGET_VERSION} LESS 66)
45
63
  )
46
64
  endif()
47
65
 
66
+ if(${IS_NEW_ARCHITECTURE_ENABLED})
67
+ set(
68
+ FABRIC_UTILS_CPP
69
+ "${COMMON_SRC_DIR}/cpp/Fabric/FabricUtils.cpp"
70
+ )
71
+ set(
72
+ REANIMATED_UI_MANAGER_BINDING_CPP
73
+ "${COMMON_SRC_DIR}/cpp/Fabric/ReanimatedUIManagerBinding.cpp"
74
+ )
75
+ endif()
76
+
48
77
  add_library(
49
78
  ${PACKAGE_NAME}
50
79
  SHARED
@@ -63,6 +92,8 @@ add_library(
63
92
  "${COMMON_SRC_DIR}/cpp/Tools/FeaturesConfig.cpp"
64
93
  "${COMMON_SRC_DIR}/cpp/LayoutAnimations/LayoutAnimationsProxy.cpp"
65
94
  "${COMMON_SRC_DIR}/cpp/AnimatedSensor/AnimatedSensorModule.cpp"
95
+ ${FABRIC_UTILS_CPP}
96
+ ${REANIMATED_UI_MANAGER_BINDING_CPP}
66
97
  )
67
98
 
68
99
  # includes
@@ -81,11 +112,15 @@ target_include_directories(
81
112
  "${NODE_MODULES_DIR}/react-native/React/Base"
82
113
  "${NODE_MODULES_DIR}/react-native/ReactAndroid/src/main/jni"
83
114
  "${NODE_MODULES_DIR}/react-native/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni"
115
+ "${NODE_MODULES_DIR}/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/jni"
84
116
  "${NODE_MODULES_DIR}/react-native/ReactCommon"
85
117
  "${NODE_MODULES_DIR}/react-native/ReactCommon/callinvoker"
86
118
  "${NODE_MODULES_DIR}/react-native/ReactCommon/jsi"
119
+ "${NODE_MODULES_DIR}/react-native/ReactCommon/react/renderer/graphics/platform/cxx"
120
+ "${NODE_MODULES_DIR}/react-native/ReactCommon/runtimeexecutor"
87
121
  "${NODE_MODULES_DIR}/react-native/ReactCommon/turbomodule/core"
88
122
  "${NODE_MODULES_DIR}/react-native/ReactCommon/turbomodule"
123
+ "${NODE_MODULES_DIR}/react-native/ReactCommon/yoga"
89
124
  "${NODE_MODULES_DIR}/hermes-engine/android/include/"
90
125
  "${COMMON_SRC_DIR}/cpp/headers/Tools"
91
126
  "${COMMON_SRC_DIR}/cpp/headers/SpecTools"
@@ -94,15 +129,11 @@ target_include_directories(
94
129
  "${COMMON_SRC_DIR}/cpp/headers/Registries"
95
130
  "${COMMON_SRC_DIR}/cpp/headers/LayoutAnimations"
96
131
  "${COMMON_SRC_DIR}/cpp/headers/AnimatedSensor"
132
+ "${COMMON_SRC_DIR}/cpp/headers/Fabric"
97
133
  "${COMMON_SRC_DIR}/cpp/hidden_headers"
98
134
  "${SRC_DIR}/main/cpp/headers"
99
135
  )
100
136
 
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
137
  find_library(
107
138
  LOG_LIB
108
139
  log
@@ -119,26 +150,18 @@ find_library(
119
150
  PATHS ${LIBRN_DIR}
120
151
  NO_CMAKE_FIND_ROOT_PATH
121
152
  )
122
- find_library(
123
- FOLLY_JSON_LIB
124
- folly_json
125
- PATHS ${LIBRN_DIR}
126
- NO_CMAKE_FIND_ROOT_PATH
127
- )
128
153
  find_library(
129
154
  REACT_NATIVE_JNI_LIB
130
155
  reactnativejni
131
156
  PATHS ${LIBRN_DIR}
132
157
  NO_CMAKE_FIND_ROOT_PATH
133
158
  )
134
-
135
159
  find_library(
136
160
  GLOG_LIB
137
161
  glog
138
162
  PATHS ${LIBRN_DIR}
139
163
  NO_CMAKE_FIND_ROOT_PATH
140
164
  )
141
-
142
165
  find_library(
143
166
  FBJNI_LIB
144
167
  fbjni
@@ -146,15 +169,88 @@ find_library(
146
169
  NO_CMAKE_FIND_ROOT_PATH
147
170
  )
148
171
 
172
+ if(${REACT_NATIVE_TARGET_VERSION} LESS 69)
173
+ find_library(
174
+ FOLLY_LIB
175
+ folly_json
176
+ PATHS ${LIBRN_DIR}
177
+ NO_CMAKE_FIND_ROOT_PATH
178
+ )
179
+ else()
180
+ find_library(
181
+ FOLLY_LIB
182
+ folly_runtime
183
+ PATHS ${LIBRN_DIR}
184
+ NO_CMAKE_FIND_ROOT_PATH
185
+ )
186
+ endif()
187
+
149
188
  if(${REACT_NATIVE_TARGET_VERSION} LESS 66)
150
- set (JSI_LIB "")
189
+ set (JSI_LIB "")
151
190
  else()
152
- find_library(
153
- JSI_LIB
154
- jsi
155
- PATHS ${LIBRN_DIR}
156
- NO_CMAKE_FIND_ROOT_PATH
157
- )
191
+ find_library(
192
+ JSI_LIB
193
+ jsi
194
+ PATHS ${LIBRN_DIR}
195
+ NO_CMAKE_FIND_ROOT_PATH
196
+ )
197
+ endif()
198
+
199
+ if(${IS_NEW_ARCHITECTURE_ENABLED})
200
+ find_library(
201
+ REACT_RENDER_UIMANAGER
202
+ react_render_uimanager
203
+ PATHS ${LIBRN_DIR}
204
+ NO_CMAKE_FIND_ROOT_PATH
205
+ )
206
+ find_library(
207
+ REACT_RENDER_MOUNTING
208
+ react_render_mounting
209
+ PATHS ${LIBRN_DIR}
210
+ NO_CMAKE_FIND_ROOT_PATH
211
+ )
212
+ find_library(
213
+ REACT_RENDER_COMPONENTREGISTRY
214
+ react_render_componentregistry
215
+ PATHS ${LIBRN_DIR}
216
+ NO_CMAKE_FIND_ROOT_PATH
217
+ )
218
+ find_library(
219
+ REACT_RENDER_CORE
220
+ react_render_core
221
+ PATHS ${LIBRN_DIR}
222
+ NO_CMAKE_FIND_ROOT_PATH
223
+ )
224
+ find_library(
225
+ REACT_DEBUG
226
+ react_debug
227
+ PATHS ${LIBRN_DIR}
228
+ NO_CMAKE_FIND_ROOT_PATH
229
+ )
230
+ find_library(
231
+ REACT_RENDER_DEBUG
232
+ react_render_debug
233
+ PATHS ${LIBRN_DIR}
234
+ NO_CMAKE_FIND_ROOT_PATH
235
+ )
236
+ find_library(
237
+ RRC_ROOT
238
+ rrc_root
239
+ PATHS ${LIBRN_DIR}
240
+ NO_CMAKE_FIND_ROOT_PATH
241
+ )
242
+ find_library(
243
+ REACT_RENDER_SCHEDULER
244
+ react_render_scheduler
245
+ PATHS ${LIBRN_DIR}
246
+ NO_CMAKE_FIND_ROOT_PATH
247
+ )
248
+ find_library(
249
+ FABRICJNI
250
+ fabricjni
251
+ PATHS ${LIBRN_DIR}
252
+ NO_CMAKE_FIND_ROOT_PATH
253
+ )
158
254
  endif()
159
255
 
160
256
  # build shared lib
@@ -169,7 +265,7 @@ if(${FOR_HERMES})
169
265
  ${HERMES_LIB}
170
266
  ${GLOG_LIB}
171
267
  ${FBJNI_LIB}
172
- ${FOLLY_JSON_LIB}
268
+ ${FOLLY_LIB}
173
269
  ${REACT_NATIVE_JNI_LIB}
174
270
  android
175
271
  )
@@ -178,6 +274,7 @@ else()
178
274
  ${PACKAGE_NAME}
179
275
  ${LOG_LIB}
180
276
  ${JSI_LIB}
277
+ ${FOLLY_LIB}
181
278
  ${JSEXECUTOR_LIB}
182
279
  ${GLOG_LIB}
183
280
  ${FBJNI_LIB}
@@ -187,6 +284,21 @@ else()
187
284
  )
188
285
  endif()
189
286
 
287
+ if(${IS_NEW_ARCHITECTURE_ENABLED})
288
+ target_link_libraries(
289
+ ${PACKAGE_NAME}
290
+ ${REACT_RENDER_UIMANAGER}
291
+ ${REACT_RENDER_MOUNTING}
292
+ ${REACT_RENDER_COMPONENTREGISTRY}
293
+ ${REACT_RENDER_CORE}
294
+ ${REACT_DEBUG}
295
+ ${REACT_RENDER_DEBUG}
296
+ ${RRC_ROOT}
297
+ ${FABRICJNI}
298
+ ${REACT_RENDER_SCHEDULER}
299
+ )
300
+ endif()
301
+
190
302
  if(${REACT_NATIVE_TARGET_VERSION} LESS 64)
191
303
  add_library(
192
304
  turbomodulejsijni