react-native-reanimated 2.5.0 → 2.8.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 (221) hide show
  1. package/Common/cpp/SharedItems/ShareableValue.cpp +2 -2
  2. package/Common/cpp/Tools/RuntimeDecorator.cpp +0 -14
  3. package/RNReanimated.podspec +15 -6
  4. package/android/.gradle/7.2/dependencies-accessors/dependencies-accessors.lock +0 -0
  5. package/android/.gradle/7.2/executionHistory/executionHistory.bin +0 -0
  6. package/android/.gradle/7.2/executionHistory/executionHistory.lock +0 -0
  7. package/android/.gradle/7.2/fileHashes/fileHashes.bin +0 -0
  8. package/android/.gradle/7.2/fileHashes/fileHashes.lock +0 -0
  9. package/android/.gradle/7.2/fileHashes/resourceHashesCache.bin +0 -0
  10. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  11. package/android/.gradle/buildOutputCleanup/cache.properties +1 -1
  12. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  13. package/android/.gradle/checksums/checksums.lock +0 -0
  14. package/android/.gradle/checksums/md5-checksums.bin +0 -0
  15. package/android/.gradle/checksums/sha1-checksums.bin +0 -0
  16. package/android/build.gradle +13 -23
  17. package/android/react-native-reanimated-64-hermes.aar +0 -0
  18. package/android/react-native-reanimated-64-jsc.aar +0 -0
  19. package/android/react-native-reanimated-65-hermes.aar +0 -0
  20. package/android/react-native-reanimated-65-jsc.aar +0 -0
  21. package/android/react-native-reanimated-66-hermes.aar +0 -0
  22. package/android/react-native-reanimated-66-jsc.aar +0 -0
  23. package/android/react-native-reanimated-67-hermes.aar +0 -0
  24. package/android/react-native-reanimated-67-jsc.aar +0 -0
  25. package/android/react-native-reanimated-68-hermes.aar +0 -0
  26. package/android/react-native-reanimated-68-jsc.aar +0 -0
  27. package/android/src/main/cpp/NativeProxy.cpp +22 -12
  28. package/android/src/main/cpp/headers/NativeProxy.h +2 -0
  29. package/android/src/main/java/com/swmansion/reanimated/NativeProxy.java +11 -8
  30. package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/AnimationsManager.java +13 -6
  31. package/ios/LayoutReanimation/REAAnimationsManager.h +1 -1
  32. package/ios/LayoutReanimation/REAAnimationsManager.m +2 -2
  33. package/ios/LayoutReanimation/REASnapshot.m +1 -1
  34. package/ios/LayoutReanimation/REAUIManager.h +1 -1
  35. package/ios/LayoutReanimation/REAUIManager.mm +4 -5
  36. package/ios/Nodes/REAAlwaysNode.h +1 -1
  37. package/ios/Nodes/REAAlwaysNode.m +5 -5
  38. package/ios/Nodes/REABezierNode.h +1 -1
  39. package/ios/Nodes/REABezierNode.m +4 -5
  40. package/ios/Nodes/REABlockNode.h +1 -1
  41. package/ios/Nodes/REABlockNode.m +2 -2
  42. package/ios/Nodes/REACallFuncNode.h +1 -1
  43. package/ios/Nodes/REACallFuncNode.m +5 -5
  44. package/ios/Nodes/REAClockNodes.h +1 -1
  45. package/ios/Nodes/REAClockNodes.m +4 -4
  46. package/ios/Nodes/REAConcatNode.h +1 -1
  47. package/ios/Nodes/REAConcatNode.m +3 -3
  48. package/ios/Nodes/REACondNode.h +1 -1
  49. package/ios/Nodes/REACondNode.m +3 -3
  50. package/ios/Nodes/READebugNode.h +1 -1
  51. package/ios/Nodes/READebugNode.m +3 -3
  52. package/ios/Nodes/REAEventNode.h +1 -2
  53. package/ios/Nodes/REAEventNode.m +3 -3
  54. package/ios/Nodes/REAFunctionNode.h +1 -1
  55. package/ios/Nodes/REAFunctionNode.m +3 -3
  56. package/ios/Nodes/REAJSCallNode.h +1 -1
  57. package/ios/Nodes/REAJSCallNode.m +3 -3
  58. package/ios/Nodes/REANode.m +2 -2
  59. package/ios/Nodes/REAOperatorNode.h +1 -1
  60. package/ios/Nodes/REAOperatorNode.m +2 -3
  61. package/ios/Nodes/REAParamNode.h +1 -1
  62. package/ios/Nodes/REAParamNode.m +4 -4
  63. package/ios/Nodes/REAPropsNode.h +1 -1
  64. package/ios/Nodes/REAPropsNode.m +4 -6
  65. package/ios/Nodes/REASetNode.h +1 -1
  66. package/ios/Nodes/REASetNode.m +4 -4
  67. package/ios/Nodes/REAStyleNode.h +1 -1
  68. package/ios/Nodes/REAStyleNode.m +2 -3
  69. package/ios/Nodes/REATransformNode.h +1 -1
  70. package/ios/Nodes/REATransformNode.m +2 -2
  71. package/ios/Nodes/REAValueNode.h +1 -3
  72. package/ios/Nodes/REAValueNode.m +1 -1
  73. package/ios/REAEventDispatcher.m +1 -1
  74. package/ios/REAModule.h +1 -1
  75. package/ios/REAModule.m +4 -5
  76. package/ios/REANodesManager.h +1 -2
  77. package/ios/REANodesManager.m +22 -24
  78. package/ios/Transitioning/RCTConvert+REATransition.h +1 -2
  79. package/ios/Transitioning/RCTConvert+REATransition.m +1 -1
  80. package/ios/Transitioning/REAAllTransitions.h +1 -1
  81. package/ios/Transitioning/REAAllTransitions.m +2 -3
  82. package/ios/Transitioning/REATransition.h +2 -3
  83. package/ios/Transitioning/REATransition.m +3 -4
  84. package/ios/Transitioning/REATransitionAnimation.m +1 -2
  85. package/ios/Transitioning/REATransitionManager.m +2 -4
  86. package/ios/Transitioning/REATransitionValues.m +2 -3
  87. package/ios/native/NativeMethods.h +1 -3
  88. package/ios/native/NativeMethods.mm +1 -1
  89. package/ios/native/NativeProxy.h +2 -2
  90. package/ios/native/NativeProxy.mm +20 -17
  91. package/ios/native/REAIOSErrorHandler.h +2 -4
  92. package/ios/native/REAIOSErrorHandler.mm +1 -1
  93. package/ios/native/REAIOSLogger.h +1 -3
  94. package/ios/native/REAIOSLogger.mm +1 -1
  95. package/ios/native/REAIOSScheduler.h +1 -3
  96. package/ios/native/REAIOSScheduler.mm +2 -2
  97. package/ios/native/REAInitializer.h +0 -7
  98. package/ios/native/REAInitializer.mm +2 -2
  99. package/ios/native/UIResponder+Reanimated.mm +3 -3
  100. package/ios/sensor/ReanimatedSensor.h +5 -1
  101. package/ios/sensor/ReanimatedSensor.m +49 -1
  102. package/ios/sensor/ReanimatedSensorContainer.h +1 -2
  103. package/ios/sensor/ReanimatedSensorContainer.m +2 -3
  104. package/lib/Animated.js +0 -9
  105. package/lib/ConfigHelper.js +0 -1
  106. package/lib/index.js +0 -9
  107. package/lib/reanimated2/Easing.js +9 -3
  108. package/lib/reanimated2/core.js +0 -36
  109. package/lib/reanimated2/globals.d.ts +1 -2
  110. package/lib/reanimated2/interpolateColor.js +11 -11
  111. package/lib/reanimated2/js-reanimated/index.js +3 -3
  112. package/lib/types/lib/ConfigHelper.d.ts +12 -0
  113. package/lib/types/lib/ReanimatedEventEmitter.d.ts +3 -0
  114. package/lib/types/lib/ReanimatedModule.d.ts +2 -0
  115. package/lib/types/lib/ReanimatedModule.macos.d.ts +2 -0
  116. package/lib/types/lib/ReanimatedModule.native.d.ts +2 -0
  117. package/lib/types/lib/ReanimatedModule.windows.d.ts +2 -0
  118. package/lib/types/lib/ReanimatedModuleCompat.d.ts +14 -0
  119. package/lib/types/lib/createAnimatedComponent.d.ts +33 -0
  120. package/lib/types/lib/reanimated2/Bezier.d.ts +6 -0
  121. package/lib/types/lib/reanimated2/Colors.d.ts +31 -0
  122. package/lib/types/lib/reanimated2/Easing.d.ts +172 -0
  123. package/lib/types/lib/reanimated2/NativeMethods.d.ts +14 -0
  124. package/lib/types/lib/reanimated2/NativeReanimated/NativeReanimated.d.ts +20 -0
  125. package/lib/types/lib/reanimated2/NativeReanimated/index.d.ts +3 -0
  126. package/lib/types/lib/reanimated2/PlatformChecker.d.ts +5 -0
  127. package/lib/types/lib/reanimated2/PropAdapters.d.ts +4 -0
  128. package/lib/types/lib/reanimated2/UpdateProps.d.ts +9 -0
  129. package/lib/types/lib/reanimated2/ViewDescriptorsSet.d.ts +20 -0
  130. package/lib/types/lib/reanimated2/WorkletEventHandler.d.ts +13 -0
  131. package/lib/types/lib/reanimated2/__mocks__/MutableValue.d.ts +5 -0
  132. package/lib/types/lib/reanimated2/__mocks__/NativeReanimated.d.ts +13 -0
  133. package/lib/types/lib/reanimated2/__mocks__/NativeReanimated.native.d.ts +13 -0
  134. package/lib/types/lib/reanimated2/animation/commonTypes.d.ts +27 -0
  135. package/lib/types/lib/reanimated2/animation/decay.d.ts +19 -0
  136. package/lib/types/lib/reanimated2/animation/delay.d.ts +7 -0
  137. package/lib/types/lib/reanimated2/animation/index.d.ts +9 -0
  138. package/lib/types/lib/reanimated2/animation/repeat.d.ts +12 -0
  139. package/lib/types/lib/reanimated2/animation/sequence.d.ts +7 -0
  140. package/lib/types/lib/reanimated2/animation/spring.d.ts +22 -0
  141. package/lib/types/lib/reanimated2/animation/styleAnimation.d.ts +7 -0
  142. package/lib/types/lib/reanimated2/animation/timing.d.ts +21 -0
  143. package/lib/types/lib/reanimated2/animation/util.d.ts +9 -0
  144. package/lib/types/lib/reanimated2/commonTypes.d.ts +79 -0
  145. package/lib/types/lib/reanimated2/component/FlatList.d.ts +9 -0
  146. package/lib/types/lib/reanimated2/component/WrappedComponents.d.ts +8 -0
  147. package/lib/types/lib/reanimated2/component/index.d.ts +9 -0
  148. package/lib/types/lib/reanimated2/core.d.ts +24 -0
  149. package/lib/types/lib/reanimated2/hook/Hooks.d.ts +5 -0
  150. package/lib/types/lib/reanimated2/hook/commonTypes.d.ts +14 -0
  151. package/lib/types/lib/reanimated2/hook/index.d.ts +10 -0
  152. package/lib/types/lib/reanimated2/hook/useAnimatedGestureHandler.d.ts +35 -0
  153. package/lib/types/lib/reanimated2/hook/useAnimatedReaction.d.ts +12 -0
  154. package/lib/types/lib/reanimated2/hook/useAnimatedRef.d.ts +3 -0
  155. package/lib/types/lib/reanimated2/hook/useAnimatedScrollHandler.d.ts +21 -0
  156. package/lib/types/lib/reanimated2/hook/useAnimatedSensor.d.ts +18 -0
  157. package/lib/types/lib/reanimated2/hook/useAnimatedStyle.d.ts +11 -0
  158. package/lib/types/lib/reanimated2/hook/useDerivedValue.d.ts +4 -0
  159. package/lib/types/lib/reanimated2/hook/useSharedValue.d.ts +2 -0
  160. package/lib/types/lib/reanimated2/hook/utils.d.ts +28 -0
  161. package/lib/types/lib/reanimated2/index.d.ts +12 -0
  162. package/lib/types/lib/reanimated2/interpolateColor.d.ts +26 -0
  163. package/lib/types/lib/reanimated2/interpolation.d.ts +14 -0
  164. package/lib/types/lib/reanimated2/jestUtils.d.ts +12 -0
  165. package/lib/types/lib/reanimated2/js-reanimated/JSReanimated.d.ts +30 -0
  166. package/lib/types/lib/reanimated2/js-reanimated/Mapper.d.ts +14 -0
  167. package/lib/types/lib/reanimated2/js-reanimated/MapperRegistry.d.ts +14 -0
  168. package/lib/types/lib/reanimated2/js-reanimated/MutableValue.d.ts +14 -0
  169. package/lib/types/lib/reanimated2/js-reanimated/commonTypes.d.ts +44 -0
  170. package/lib/types/lib/reanimated2/js-reanimated/index.d.ts +15 -0
  171. package/lib/types/lib/reanimated2/layoutReanimation/LayoutAnimationRepository.d.ts +1 -0
  172. package/lib/types/lib/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.d.ts +22 -0
  173. package/lib/types/lib/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.d.ts +38 -0
  174. package/lib/types/lib/reanimated2/layoutReanimation/animationBuilder/Keyframe.d.ts +25 -0
  175. package/lib/types/lib/reanimated2/layoutReanimation/animationBuilder/commonTypes.d.ts +77 -0
  176. package/lib/types/lib/reanimated2/layoutReanimation/animationBuilder/index.d.ts +4 -0
  177. package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Bounce.d.ts +62 -0
  178. package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Default.d.ts +4 -0
  179. package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Fade.d.ts +42 -0
  180. package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Flip.d.ts +50 -0
  181. package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.d.ts +18 -0
  182. package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.d.ts +10 -0
  183. package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Roll.d.ts +18 -0
  184. package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Rotate.d.ts +34 -0
  185. package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Slide.d.ts +34 -0
  186. package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Stretch.d.ts +18 -0
  187. package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Zoom.d.ts +66 -0
  188. package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/index.d.ts +10 -0
  189. package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.d.ts +19 -0
  190. package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.d.ts +13 -0
  191. package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.d.ts +6 -0
  192. package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.d.ts +6 -0
  193. package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.d.ts +7 -0
  194. package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.d.ts +9 -0
  195. package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/index.d.ts +6 -0
  196. package/lib/types/lib/reanimated2/layoutReanimation/index.d.ts +4 -0
  197. package/lib/types/lib/reanimated2/mock.d.ts +55 -0
  198. package/lib/types/lib/reanimated2/platform-specific/RNRenderer.d.ts +1 -0
  199. package/lib/types/lib/reanimated2/platform-specific/RNRenderer.web.d.ts +0 -0
  200. package/lib/types/lib/reanimated2/utils.d.ts +7 -0
  201. package/lib/types/lib/setAndForwardRef.d.ts +40 -0
  202. package/lib/types/react-native-reanimated-tests.d.ts +1 -0
  203. package/package.json +7 -9
  204. package/plugin.js +26 -32
  205. package/react-native-reanimated.d.ts +39 -30
  206. package/src/Animated.js +0 -9
  207. package/src/ConfigHelper.ts +0 -1
  208. package/src/createAnimatedComponent.tsx +1 -1
  209. package/src/reanimated2/Easing.ts +9 -3
  210. package/src/reanimated2/commonTypes.ts +0 -1
  211. package/src/reanimated2/component/FlatList.tsx +1 -1
  212. package/src/reanimated2/core.ts +0 -47
  213. package/src/reanimated2/globals.d.ts +1 -2
  214. package/src/reanimated2/hook/useAnimatedSensor.ts +1 -3
  215. package/src/reanimated2/interpolateColor.ts +11 -11
  216. package/src/reanimated2/jestUtils.ts +11 -0
  217. package/src/reanimated2/js-reanimated/index.ts +3 -3
  218. package/android/expo/linking.gradle +0 -46
  219. package/android/expo/src/main/java/com/swmansion/reanimated/EXReanimatedAdapter.java +0 -12
  220. package/android/expo/src/main/java/expo/modules/adapters/reanimated/EXReanimatedPackage.java +0 -26
  221. package/expo-module.config.json +0 -3
@@ -64,7 +64,7 @@ void ShareableValue::adapt(
64
64
  jsi::Object hiddenProperty = hiddenValue.asObject(rt);
65
65
  if (hiddenProperty.isHostObject<FrozenObject>(rt)) {
66
66
  type = ValueType::FrozenObjectType;
67
- if (object.hasProperty(rt, "__worklet") && object.isFunction(rt)) {
67
+ if (object.hasProperty(rt, "__workletHash") && object.isFunction(rt)) {
68
68
  type = ValueType::WorkletFunctionType;
69
69
  }
70
70
  valueContainer = std::make_unique<FrozenObjectWrapper>(
@@ -99,7 +99,7 @@ void ShareableValue::adapt(
99
99
  } else if (value.isObject()) {
100
100
  auto object = value.asObject(rt);
101
101
  if (object.isFunction(rt)) {
102
- if (object.getProperty(rt, "__worklet").isUndefined()) {
102
+ if (object.getProperty(rt, "__workletHash").isUndefined()) {
103
103
  // not a worklet, we treat this as a host function
104
104
  type = ValueType::HostFunctionType;
105
105
  containsHostFunction = true;
@@ -31,20 +31,6 @@ void RuntimeDecorator::decorateRuntime(
31
31
  rt, "_LABEL", jsi::String::createFromAscii(rt, label));
32
32
 
33
33
  jsi::Object dummyGlobal(rt);
34
- auto dummyFunction = [](jsi::Runtime &rt,
35
- const jsi::Value &thisValue,
36
- const jsi::Value *args,
37
- size_t count) -> jsi::Value {
38
- return jsi::Value::undefined();
39
- };
40
- jsi::Function __reanimatedWorkletInit = jsi::Function::createFromHostFunction(
41
- rt,
42
- jsi::PropNameID::forAscii(rt, "__reanimatedWorkletInit"),
43
- 1,
44
- dummyFunction);
45
-
46
- dummyGlobal.setProperty(
47
- rt, "__reanimatedWorkletInit", __reanimatedWorkletInit);
48
34
  rt.global().setProperty(rt, "global", dummyGlobal);
49
35
 
50
36
  rt.global().setProperty(rt, "jsThis", jsi::Value::undefined());
@@ -3,27 +3,34 @@ require "json"
3
3
  package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
4
 
5
5
  reactVersion = '0.0.0'
6
+ reactTargetTvOS = false
6
7
 
7
8
  begin
8
9
  # standard app
9
10
  # /appName/node_modules/react-native-reanimated/RNReanimated.podspec
10
11
  # /appName/node_modules/react-native/package.json
11
- reactVersion = JSON.parse(File.read(File.join(__dir__, "..", "..", "node_modules", "react-native", "package.json")))["version"]
12
+ reactJson = JSON.parse(File.read(File.join(__dir__, "..", "..", "node_modules", "react-native", "package.json")))
13
+ reactVersion = reactJson["version"]
14
+ reactTargetTvOS = reactJson["name"] == "react-native-tvos"
12
15
  rescue
13
16
  begin
14
17
  # monorepo
15
18
  # /monorepo/packages/appName/node_modules/react-native-reanimated/RNReanimated.podspec
16
19
  # /monorepo/node_modules/react-native/package.json
17
- reactVersion = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "..", "node_modules", "react-native", "package.json")))["version"]
20
+ reactJson = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "..", "node_modules", "react-native", "package.json")))
21
+ reactVersion = reactJson["version"]
22
+ reactTargetTvOS = reactJson["name"] == "react-native-tvos"
18
23
  rescue
19
24
  begin
20
25
  # Example app in reanimated repo
21
26
  # /react-native-reanimated/RNReanimated.podspec
22
27
  # /react-native-reanimated/node_modules/react-native/package.json
23
- reactVersion = JSON.parse(File.read(File.join(__dir__, "node_modules", "react-native", "package.json")))["version"]
28
+ reactJson = JSON.parse(File.read(File.join(__dir__, "node_modules", "react-native", "package.json")))
29
+ reactVersion = reactJson["version"]
30
+ reactTargetTvOS = ENV["ReanimatedTVOSExample"] == "1"
24
31
  rescue
25
32
  # should never happen
26
- reactVersion = '0.66.0'
33
+ reactVersion = '0.68.0'
27
34
  puts "[RNReanimated] Unable to recognized your `react-native` version! Default `react-native` version: " + reactVersion
28
35
  end
29
36
  end
@@ -78,7 +85,7 @@ Pod::Spec.new do |s|
78
85
 
79
86
  s.requires_arc = true
80
87
 
81
- s.dependency "React"
88
+ s.dependency "React-Core"
82
89
  s.dependency 'FBLazyVector'
83
90
  s.dependency 'FBReactNativeSpec'
84
91
  s.dependency 'RCTRequired'
@@ -86,7 +93,9 @@ Pod::Spec.new do |s|
86
93
  s.dependency 'React-Core'
87
94
  s.dependency 'React-CoreModules'
88
95
  s.dependency 'React-Core/DevSupport'
89
- s.dependency 'React-RCTActionSheet'
96
+ if !reactTargetTvOS
97
+ s.dependency 'React-RCTActionSheet'
98
+ end
90
99
  s.dependency 'React-RCTNetwork'
91
100
  s.dependency 'React-RCTAnimation'
92
101
  s.dependency 'React-RCTLinking'
@@ -1,2 +1,2 @@
1
- #Mon Mar 21 07:47:31 UTC 2022
1
+ #Thu Apr 21 15:44:53 UTC 2022
2
2
  gradle.version=7.2
@@ -74,15 +74,6 @@ def resolveBuildType() {
74
74
  return true
75
75
  }
76
76
 
77
- def resolveExpoLinkingGradle() {
78
- def gradleScript = file("./expo/linking.gradle")
79
- if (gradleScript.exists()) {
80
- return "./expo/linking.gradle"
81
- } else {
82
- return "../android-npm/expo/linking.gradle"
83
- }
84
- }
85
-
86
77
  def isDeveloperMode() {
87
78
  // developer mode, to run Example app
88
79
  return file("$projectDir/../node_modules/react-native/package.json").exists()
@@ -291,9 +282,6 @@ if (!BUILD_FROM_SOURCE) {
291
282
  // end if already loaded aar
292
283
  if (!BUILD_FROM_SOURCE) return
293
284
 
294
- // apply expo config
295
- apply from: resolveExpoLinkingGradle()
296
-
297
285
  def localProps = new Properties()
298
286
  def localPropertiesFile = file("local.properties")
299
287
  if (localPropertiesFile.exists()) {
@@ -701,17 +689,19 @@ task downloadNdkBuildDependencies {
701
689
  task prepareThirdPartyNdkHeaders(dependsOn:[downloadNdkBuildDependencies, prepareBoost, prepareDoubleConversion, prepareFolly, prepareGlog]) {
702
690
  }
703
691
 
704
- tasks.whenTaskAdded { task ->
705
- if (
706
- task.name.contains("externalNativeBuild")
707
- || task.name.contains("buildCMake")
708
- ) {
709
- task.dependsOn(prepareThirdPartyNdkHeaders)
710
- extractAARHeaders.dependsOn(prepareThirdPartyNdkHeaders)
711
- extractSOFiles.dependsOn(prepareThirdPartyNdkHeaders)
712
- task.dependsOn(extractAARHeaders)
713
- task.dependsOn(extractSOFiles)
714
- }
692
+ def nativeBuildDependsOn(dependsOnTask) {
693
+ def buildTasks = tasks.findAll({ task ->
694
+ !task.name.contains("Clean") && (task.name.contains("externalNative") || task.name.contains("CMake")) })
695
+ buildTasks.forEach { task -> task.dependsOn(dependsOnTask) }
696
+ }
697
+
698
+ afterEvaluate {
699
+ extractAARHeaders.dependsOn(prepareThirdPartyNdkHeaders)
700
+ extractSOFiles.dependsOn(prepareThirdPartyNdkHeaders)
701
+
702
+ nativeBuildDependsOn(prepareThirdPartyNdkHeaders)
703
+ nativeBuildDependsOn(extractAARHeaders)
704
+ nativeBuildDependsOn(extractSOFiles)
715
705
  }
716
706
 
717
707
  if (CLIENT_SIDE_BUILD) {
@@ -37,6 +37,13 @@ NativeProxy::NativeProxy(
37
37
  scheduler_(scheduler),
38
38
  layoutAnimations(std::move(_layoutAnimations)) {}
39
39
 
40
+ NativeProxy::~NativeProxy() {
41
+ runtime_->global().setProperty(
42
+ *runtime_,
43
+ jsi::PropNameID::forAscii(*runtime_, "__reanimatedModuleProxy"),
44
+ jsi::Value::undefined());
45
+ }
46
+
40
47
  jni::local_ref<NativeProxy::jhybriddata> NativeProxy::initHybrid(
41
48
  jni::alias_ref<jhybridobject> jThis,
42
49
  jlong jsContext,
@@ -192,18 +199,21 @@ void NativeProxy::installJSIBindings() {
192
199
  platformDepMethodsHolder);
193
200
 
194
201
  _nativeReanimatedModule = module;
195
-
196
- this->registerEventHandler([module, getCurrentTime](
197
- std::string eventName,
198
- std::string eventAsString) {
199
- jsi::Object global = module->runtime->global();
200
- jsi::String eventTimestampName =
201
- jsi::String::createFromAscii(*module->runtime, "_eventTimestamp");
202
- global.setProperty(*module->runtime, eventTimestampName, getCurrentTime());
203
- module->onEvent(eventName, eventAsString);
204
- global.setProperty(
205
- *module->runtime, eventTimestampName, jsi::Value::undefined());
206
- });
202
+ std::weak_ptr<NativeReanimatedModule> weakModule = module;
203
+ this->registerEventHandler(
204
+ [weakModule, getCurrentTime](
205
+ std::string eventName, std::string eventAsString) {
206
+ if (auto module = weakModule.lock()) {
207
+ jsi::Object global = module->runtime->global();
208
+ jsi::String eventTimestampName =
209
+ jsi::String::createFromAscii(*module->runtime, "_eventTimestamp");
210
+ global.setProperty(
211
+ *module->runtime, eventTimestampName, getCurrentTime());
212
+ module->onEvent(eventName, eventAsString);
213
+ global.setProperty(
214
+ *module->runtime, eventTimestampName, jsi::Value::undefined());
215
+ }
216
+ });
207
217
 
208
218
  runtime_->global().setProperty(
209
219
  *runtime_,
@@ -131,6 +131,8 @@ class NativeProxy : public jni::HybridClass<NativeProxy> {
131
131
  jni::alias_ref<LayoutAnimations::javaobject> layoutAnimations);
132
132
  static void registerNatives();
133
133
 
134
+ ~NativeProxy();
135
+
134
136
  private:
135
137
  friend HybridBase;
136
138
  jni::global_ref<NativeProxy::javaobject> javaPart_;
@@ -147,14 +147,17 @@ public class NativeProxy {
147
147
  }
148
148
 
149
149
  private void addDevMenuOption() {
150
- final DevSupportManager devSupportManager =
151
- ((ReactApplication) mContext.get().getApplicationContext())
152
- .getReactNativeHost()
153
- .getReactInstanceManager()
154
- .getDevSupportManager();
155
-
156
- devSupportManager.addCustomDevOption(
157
- "Toggle slow animations (Reanimated)", this::toggleSlowAnimations);
150
+ // In Expo, `ApplicationContext` is not an instance of `ReactApplication`
151
+ if (mContext.get().getApplicationContext() instanceof ReactApplication) {
152
+ final DevSupportManager devSupportManager =
153
+ ((ReactApplication) mContext.get().getApplicationContext())
154
+ .getReactNativeHost()
155
+ .getReactInstanceManager()
156
+ .getDevSupportManager();
157
+
158
+ devSupportManager.addCustomDevOption(
159
+ "Toggle slow animations (Reanimated)", this::toggleSlowAnimations);
160
+ }
158
161
  }
159
162
 
160
163
  @DoNotStrip
@@ -1,5 +1,6 @@
1
1
  package com.swmansion.reanimated.layoutReanimation;
2
2
 
3
+ import android.app.Activity;
3
4
  import android.util.DisplayMetrics;
4
5
  import android.util.Log;
5
6
  import android.view.View;
@@ -368,12 +369,18 @@ public class AnimationsManager implements ViewHierarchyObserver {
368
369
  preparedValues.put(key, PixelUtil.toDIPFromPixel((int) values.get(key)));
369
370
  }
370
371
 
371
- DisplayMetrics displaymetrics = new DisplayMetrics();
372
- mContext.getCurrentActivity().getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
373
- int height = displaymetrics.heightPixels;
374
- int width = displaymetrics.widthPixels;
375
- preparedValues.put("windowWidth", PixelUtil.toDIPFromPixel(width));
376
- preparedValues.put("windowHeight", PixelUtil.toDIPFromPixel(height));
372
+ DisplayMetrics displayMetrics = new DisplayMetrics();
373
+ Activity currentActivity = mContext.getCurrentActivity();
374
+ if (currentActivity != null) {
375
+ currentActivity.getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
376
+ int height = displayMetrics.heightPixels;
377
+ int width = displayMetrics.widthPixels;
378
+ preparedValues.put("windowWidth", PixelUtil.toDIPFromPixel(width));
379
+ preparedValues.put("windowHeight", PixelUtil.toDIPFromPixel(height));
380
+ } else {
381
+ preparedValues.put("windowWidth", PixelUtil.toDIPFromPixel(0));
382
+ preparedValues.put("windowHeight", PixelUtil.toDIPFromPixel(0));
383
+ }
377
384
  return preparedValues;
378
385
  }
379
386
 
@@ -1,6 +1,6 @@
1
1
  #import <Foundation/Foundation.h>
2
+ #import <RNReanimated/REASnapshot.h>
2
3
  #import <React/RCTUIManager.h>
3
- #import "REASnapshot.h"
4
4
 
5
5
  NS_ASSUME_NONNULL_BEGIN
6
6
 
@@ -1,9 +1,9 @@
1
- #import "REAAnimationsManager.h"
1
+ #import <RNReanimated/REAAnimationsManager.h>
2
+ #import <RNReanimated/REAUIManager.h>
2
3
  #import <React/RCTComponentData.h>
3
4
  #import <React/RCTTextView.h>
4
5
  #import <React/UIView+Private.h>
5
6
  #import <React/UIView+React.h>
6
- #import "REAUIManager.h"
7
7
 
8
8
  @interface REAAnimationsManager ()
9
9
 
@@ -1,5 +1,5 @@
1
- #import "REASnapshot.h"
2
1
  #import <Foundation/Foundation.h>
2
+ #import <RNReanimated/REASnapshot.h>
3
3
 
4
4
  NS_ASSUME_NONNULL_BEGIN
5
5
 
@@ -1,7 +1,7 @@
1
+ #import <RNReanimated/REAAnimationsManager.h>
1
2
  #import <React/RCTBridge+Private.h>
2
3
  #import <React/RCTDefines.h>
3
4
  #import <React/RCTUIManager.h>
4
- #import "REAAnimationsManager.h"
5
5
 
6
6
  NS_ASSUME_NONNULL_BEGIN
7
7
 
@@ -1,9 +1,8 @@
1
- #import "REAUIManager.h"
2
1
  #import <Foundation/Foundation.h>
3
- #include "FeaturesConfig.h"
4
- #import "REAIOSScheduler.h"
5
- #include "Scheduler.h"
6
-
2
+ #import <RNReanimated/FeaturesConfig.h>
3
+ #import <RNReanimated/REAIOSScheduler.h>
4
+ #import <RNReanimated/REAUIManager.h>
5
+ #import <RNReanimated/Scheduler.h>
7
6
  #import <React/RCTComponentData.h>
8
7
  #import <React/RCTLayoutAnimation.h>
9
8
  #import <React/RCTLayoutAnimationGroup.h>
@@ -1,4 +1,4 @@
1
- #import "REANode.h"
1
+ #import <RNReanimated/REANode.h>
2
2
 
3
3
  @interface REAAlwaysNode : REANode <REAFinalNode>
4
4
  @end
@@ -1,11 +1,11 @@
1
- #import "REAAlwaysNode.h"
1
+ #import <RNReanimated/REAAlwaysNode.h>
2
+ #import <RNReanimated/REAModule.h>
3
+ #import <RNReanimated/REANodesManager.h>
4
+ #import <RNReanimated/REAStyleNode.h>
5
+ #import <RNReanimated/REAUtils.h>
2
6
  #import <React/RCTConvert.h>
3
7
  #import <React/RCTLog.h>
4
8
  #import <React/RCTUIManager.h>
5
- #import "REAModule.h"
6
- #import "REANodesManager.h"
7
- #import "REAStyleNode.h"
8
- #import "REAUtils.h"
9
9
 
10
10
  @implementation REAAlwaysNode {
11
11
  NSNumber *_nodeToBeEvaluated;
@@ -1,4 +1,4 @@
1
- #import "REANode.h"
1
+ #import <RNReanimated/REANode.h>
2
2
 
3
3
  @interface REABezierNode : REANode
4
4
 
@@ -1,10 +1,9 @@
1
- #include <tgmath.h>
2
-
1
+ #import <RNReanimated/REABezierNode.h>
2
+ #import <RNReanimated/REANodesManager.h>
3
+ #import <RNReanimated/REAUtils.h>
3
4
  #import <React/RCTConvert.h>
4
5
  #import <React/RCTLog.h>
5
- #import "REABezierNode.h"
6
- #import "REANodesManager.h"
7
- #import "REAUtils.h"
6
+ #include <tgmath.h>
8
7
 
9
8
  #define EPS 1e-5
10
9
 
@@ -1,4 +1,4 @@
1
- #import "REANode.h"
1
+ #import <RNReanimated/REANode.h>
2
2
 
3
3
  @interface REABlockNode : REANode
4
4
 
@@ -1,5 +1,5 @@
1
- #import "REABlockNode.h"
2
- #import "REANodesManager.h"
1
+ #import <RNReanimated/REABlockNode.h>
2
+ #import <RNReanimated/REANodesManager.h>
3
3
 
4
4
  @implementation REABlockNode {
5
5
  NSArray<NSNumber *> *_block;
@@ -1,5 +1,5 @@
1
1
 
2
- #import "REANode.h"
2
+ #import <RNReanimated/REANode.h>
3
3
 
4
4
  @interface REACallFuncNode : REANode
5
5
 
@@ -1,10 +1,10 @@
1
1
 
2
2
 
3
- #import "REACallFuncNode.h"
4
- #import "REAFunctionNode.h"
5
- #import "REANodesManager.h"
6
- #import "REAParamNode.h"
7
- #import "REAUtils.h"
3
+ #import <RNReanimated/REACallFuncNode.h>
4
+ #import <RNReanimated/REAFunctionNode.h>
5
+ #import <RNReanimated/REANodesManager.h>
6
+ #import <RNReanimated/REAParamNode.h>
7
+ #import <RNReanimated/REAUtils.h>
8
8
 
9
9
  @implementation REACallFuncNode {
10
10
  NSNumber *_whatNodeID;
@@ -1,4 +1,4 @@
1
- #import "REANode.h"
1
+ #import <RNReanimated/REANode.h>
2
2
 
3
3
  @interface REAClockNode : REANode
4
4
  @property (nonatomic, readonly) BOOL isRunning;
@@ -1,9 +1,9 @@
1
- #import "REAClockNodes.h"
1
+ #import <RNReanimated/REAClockNodes.h>
2
+ #import <RNReanimated/REANodesManager.h>
3
+ #import <RNReanimated/REAParamNode.h>
4
+ #import <RNReanimated/REAUtils.h>
2
5
  #import <React/RCTConvert.h>
3
6
  #import <React/RCTLog.h>
4
- #import "REANodesManager.h"
5
- #import "REAParamNode.h"
6
- #import "REAUtils.h"
7
7
 
8
8
  @interface REAClockNode ()
9
9
 
@@ -1,4 +1,4 @@
1
- #import "REANode.h"
1
+ #import <RNReanimated/REANode.h>
2
2
 
3
3
  @interface REAConcatNode : REANode
4
4
 
@@ -1,6 +1,6 @@
1
- #import "REAConcatNode.h"
2
- #import "REANodesManager.h"
3
- #import "REAValueNode.h"
1
+ #import <RNReanimated/REAConcatNode.h>
2
+ #import <RNReanimated/REANodesManager.h>
3
+ #import <RNReanimated/REAValueNode.h>
4
4
 
5
5
  @implementation REAConcatNode {
6
6
  NSArray<NSNumber *> *_input;
@@ -1,4 +1,4 @@
1
- #import "REANode.h"
1
+ #import <RNReanimated/REANode.h>
2
2
 
3
3
  @interface REACondNode : REANode
4
4
 
@@ -1,8 +1,8 @@
1
- #import "REACondNode.h"
1
+ #import <RNReanimated/REACondNode.h>
2
+ #import <RNReanimated/REANodesManager.h>
3
+ #import <RNReanimated/REAUtils.h>
2
4
  #import <React/RCTConvert.h>
3
5
  #import <React/RCTLog.h>
4
- #import "REANodesManager.h"
5
- #import "REAUtils.h"
6
6
 
7
7
  @implementation REACondNode {
8
8
  NSNumber *_condNodeID;
@@ -1,4 +1,4 @@
1
- #import "REANode.h"
1
+ #import <RNReanimated/REANode.h>
2
2
 
3
3
  @interface READebugNode : REANode
4
4
 
@@ -1,8 +1,8 @@
1
- #import "READebugNode.h"
1
+ #import <RNReanimated/READebugNode.h>
2
+ #import <RNReanimated/REANodesManager.h>
3
+ #import <RNReanimated/REAUtils.h>
2
4
  #import <React/RCTConvert.h>
3
5
  #import <React/RCTLog.h>
4
- #import "REANodesManager.h"
5
- #import "REAUtils.h"
6
6
 
7
7
  @implementation READebugNode {
8
8
  NSNumber *_valueNodeID;
@@ -1,5 +1,4 @@
1
- #import "REANode.h"
2
-
1
+ #import <RNReanimated/REANode.h>
3
2
  #import <React/RCTEventDispatcher.h>
4
3
 
5
4
  @interface REAEventNode : REANode
@@ -1,6 +1,6 @@
1
- #import "REAEventNode.h"
2
- #import "REANodesManager.h"
3
- #import "REAValueNode.h"
1
+ #import <RNReanimated/REAEventNode.h>
2
+ #import <RNReanimated/REANodesManager.h>
3
+ #import <RNReanimated/REAValueNode.h>
4
4
 
5
5
  @implementation REAEventNode {
6
6
  NSArray *_argMapping;
@@ -1,5 +1,5 @@
1
1
 
2
- #import "REANode.h"
2
+ #import <RNReanimated/REANode.h>
3
3
 
4
4
  @interface REAFunctionNode : REANode
5
5
 
@@ -1,7 +1,7 @@
1
1
 
2
- #import "REAFunctionNode.h"
3
- #import "REANodesManager.h"
4
- #import "REAParamNode.h"
2
+ #import <RNReanimated/REAFunctionNode.h>
3
+ #import <RNReanimated/REANodesManager.h>
4
+ #import <RNReanimated/REAParamNode.h>
5
5
 
6
6
  @implementation REAFunctionNode {
7
7
  NSNumber *_nodeToBeEvaluated;
@@ -1,4 +1,4 @@
1
- #import "REANode.h"
1
+ #import <RNReanimated/REANode.h>
2
2
 
3
3
  @interface REAJSCallNode : REANode
4
4
 
@@ -1,6 +1,6 @@
1
- #import "REAJSCallNode.h"
2
- #import "REAModule.h"
3
- #import "REANodesManager.h"
1
+ #import <RNReanimated/REAJSCallNode.h>
2
+ #import <RNReanimated/REAModule.h>
3
+ #import <RNReanimated/REANodesManager.h>
4
4
 
5
5
  @implementation REAJSCallNode {
6
6
  NSArray<NSNumber *> *_input;
@@ -1,5 +1,5 @@
1
- #import "REANode.h"
2
- #import "REANodesManager.h"
1
+ #import <RNReanimated/REANode.h>
2
+ #import <RNReanimated/REANodesManager.h>
3
3
 
4
4
  #import <React/RCTDefines.h>
5
5
 
@@ -1,4 +1,4 @@
1
- #import "REANode.h"
1
+ #import <RNReanimated/REANode.h>
2
2
 
3
3
  @interface REAOperatorNode : REANode
4
4